victor_Athoti
New Member
- Joined
- May 10, 2012
- Messages
- 1
Hi all,
i am new to this forum,i have create one word document template by manually and add the table and headers in that template,i can bind the data set values to this template using vb
And add the rows using
myxmlnode.Range.Select()
Travelerdoc.ActiveWindow.Selection.InsertRowsBelow()
but i have add one more row it showing error like There is no Row at position:3(actually in my dataset i have 3 rows).How can i solve this error please help me....
i am new to this forum,i have create one word document template by manually and add the table and headers in that template,i can bind the data set values to this template using vb
For Each myxmlnode In Travelerdoc.XMLNodes
If myxmlnode.BaseName = "WONumber" Then myxmlnode.Range.Text = ds.Tables(0).Rows(0).Item("wo").ToString()
If myxmlnode.BaseName = "CreatedDate" Then myxmlnode.Range.Text = Format(ds.Tables(0).Rows(0).Item("createddate"), Globalization.DateTimeFormatInfo.CurrentInfo.ShortDatePattern)
If myxmlnode.BaseName = "CompanyName" Then myxmlnode.Range.Text = CompanyName 'acct.Name
If myxmlnode.BaseName = "CompanyAddress" Then myxmlnode.Range.Text = CompanyAddress 'address.Address1
If myxmlnode.BaseName = "CompanyAddress1" Then myxmlnode.Range.Text = CompanyAddress1 'address.City & ", " & address.State & " " & address.ZipCode
If myxmlnode.BaseName = "Phone" Then myxmlnode.Range.Text = Phone 'acct.BusinessPhone
If myxmlnode.BaseName = "Fax" Then myxmlnode.Range.Text = Fax 'acct.BusinessFax
If myxmlnode.BaseName = "Email" Then myxmlnode.Range.Text = Email 'acct.Email
If myxmlnode.BaseName = "Item" Then myxmlnode.Range.Text = Item 'myCompItem.Name
If myxmlnode.BaseName = "ItemDesc" Then myxmlnode.Range.Text = ItemDesc 'myCompItem.Name
If myxmlnode.BaseName = "WOQty" Then myxmlnode.Range.Text = Format(ds.Tables(0).Rows(0).Item("quantity"), "#0.0000")
If myxmlnode.BaseName = "QtyComp" Then myxmlnode.Range.Text = CompQty
If myxmlnode.BaseName = "StartDate" Then myxmlnode.Range.Text = Format(ds.Tables(0).Rows(0).Item("startdate"), Globalization.DateTimeFormatInfo.CurrentInfo.ShortDatePattern)
If myxmlnode.BaseName = "DueDate" Then myxmlnode.Range.Text = Format(ds.Tables(0).Rows(0).Item("duedate"), Globalization.DateTimeFormatInfo.CurrentInfo.ShortDatePattern)
If myxmlnode.BaseName = "Status" Then myxmlnode.Range.Text = ds.Tables(0).Rows(0).Item("status").ToString()
If myxmlnode.BaseName = "Customer" Then myxmlnode.Range.Text = customer
If myxmlnode.BaseName = "SO" Then myxmlnode.Range.Text = salesorder
If myxmlnode.BaseName = "WONumber" Then myxmlnode.Range.Text = ds.Tables(0).Rows(0).Item("wo").ToString()
If myxmlnode.BaseName = "CreatedDate" Then myxmlnode.Range.Text = Format(ds.Tables(0).Rows(0).Item("createddate"), Globalization.DateTimeFormatInfo.CurrentInfo.ShortDatePattern)
If myxmlnode.BaseName = "CompanyName" Then myxmlnode.Range.Text = CompanyName 'acct.Name
If myxmlnode.BaseName = "CompanyAddress" Then myxmlnode.Range.Text = CompanyAddress 'address.Address1
If myxmlnode.BaseName = "CompanyAddress1" Then myxmlnode.Range.Text = CompanyAddress1 'address.City & ", " & address.State & " " & address.ZipCode
If myxmlnode.BaseName = "Phone" Then myxmlnode.Range.Text = Phone 'acct.BusinessPhone
If myxmlnode.BaseName = "Fax" Then myxmlnode.Range.Text = Fax 'acct.BusinessFax
If myxmlnode.BaseName = "Email" Then myxmlnode.Range.Text = Email 'acct.Email
If myxmlnode.BaseName = "Item" Then myxmlnode.Range.Text = Item 'myCompItem.Name
If myxmlnode.BaseName = "ItemDesc" Then myxmlnode.Range.Text = ItemDesc 'myCompItem.Name
If myxmlnode.BaseName = "WOQty" Then myxmlnode.Range.Text = Format(ds.Tables(0).Rows(0).Item("quantity"), "#0.0000")
If myxmlnode.BaseName = "QtyComp" Then myxmlnode.Range.Text = CompQty
If myxmlnode.BaseName = "StartDate" Then myxmlnode.Range.Text = Format(ds.Tables(0).Rows(0).Item("startdate"), Globalization.DateTimeFormatInfo.CurrentInfo.ShortDatePattern)
If myxmlnode.BaseName = "DueDate" Then myxmlnode.Range.Text = Format(ds.Tables(0).Rows(0).Item("duedate"), Globalization.DateTimeFormatInfo.CurrentInfo.ShortDatePattern)
If myxmlnode.BaseName = "Status" Then myxmlnode.Range.Text = ds.Tables(0).Rows(0).Item("status").ToString()
If myxmlnode.BaseName = "Customer" Then myxmlnode.Range.Text = customer
If myxmlnode.BaseName = "SO" Then myxmlnode.Range.Text = salesorder
And add the rows using
myxmlnode.Range.Select()
Travelerdoc.ActiveWindow.Selection.InsertRowsBelow()
but i have add one more row it showing error like There is no Row at position:3(actually in my dataset i have 3 rows).How can i solve this error please help me....