473,320 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

C#NET2008 Add Row to Microsoft WORD 2003 Document Template Table

126 100+
Hullo Wonderful Friends,
I need your help again. Please help me.


I am using WORD Template which has a table containing only 1 row and 5 columns. This row is for Column headers Text. description

While using DataReader I tried to ADD row progressively during the WHILE LOOP command but this object objTable is causing Error Messages.

Here are the objTable error messages:
Error 1 No overload for method 'Add' takes '0' arguments
Error 2 Use of unassigned local variable 'objTable'
Expand|Select|Wrap|Line Numbers
  1.  Word.Table objTable;
  2.  int intRow = 0;
  3.  
  4.  while (DR.Read())
  5.  {
  6.    objTable.Rows.Add();  < --- error 
  7.  
  8.    intRow += 1;
  9.  
  10.   objTable.Cell(intRow, 1).Range.Text = Convert.ToString(DR["OrderID"]);
  11.   objTable.Cell(intRow, 2).Range.Text = Convert.ToString(DR["OrderDate"]);
  12.   objTable.Cell(intRow, 3).Range.Text = Convert.ToString(DR["RequiredDate"]);
  13.   objTable.Cell(intRow, 4).Range.Text = Convert.ToString(DR["ShippedDate"]);
  14.  objTable.Cell(intRow, 5).Range.Text = Convert.ToString(DR["Freight"]);
  15.  }
  16.  
Oct 30 '10 #1
0 1840

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: FinallyInSeattle | last post by:
I have an old product that generates a Word document using Word Automation (tables, pictures, etc). The execution speed is quite slow and I'm finally at the point where I can tell my customers...
0
by: Marco Moioli | last post by:
Hi everybody: I wanto create a simple Add-in button for Word that show me a string that represent the path of the current opened document. I know how create an Add-in button, but I don't know...
1
by: kstriyhon | last post by:
i need to create a new word 2003 document within a c# web application. this is the code i´m using private Microsoft.Office.Interop.Word.ApplicationClass WordApp = new...
1
by: =?Utf-8?B?UmF2aQ==?= | last post by:
public WordApp() { //oWordAppl = new Microsoft.Office.Interop.Word.ApplicationClass(); } When I click a button in my aspx file I geet the followign error. I am trying to open word from...
2
by: djamila | last post by:
Hi, I work in a c# project that uses Microsoft Word to generate report. In my program I use Interop.Word reference. When I run the program in my PC with Microsoft Word 2003, all work well....
2
by: davidson1 | last post by:
Hello Friends, I have installed new Windows XP.I want Microsoft word 2003...Where Can I download????.I search in Google.But I could not find a Proper website..Can you Help me....Thanks in...
2
by: lenniekuah | last post by:
Hullo Good Friends, I need your help. Please help me. I am using C#NET2008 to develop Window application I am trying to retrieve Sales Transaction and print it on WORD Document as statement...
0
by: lenniekuah | last post by:
Hullo Friends, I need your help. Pleas share with me sample coding. Doing C# Window application to output data onto Microsoft WORD Document without using Template. These are how it appear on...
1
by: Lennie Kuah | last post by:
Hi Good Guys, I need your help. Please help me. I am using C#NET2008 and Window Application to print Customer Order Transactio onto Microsoft WORD 2003 document. This is the expect result on...
0
by: lenniekuah | last post by:
Hullo Good Friends, I need your help. Please help me. I am using C#NET2008 to develop Window Application to fill Microsoft WORD 2003 Template textbox with data from FORM textbox control input my...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.