Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
recently i dealing with iTextSharp, and im new to this.
i learned how to create the table from this tutorial:
http://www.mikesdotnetting.com/Article/86/iTextSharp-Introducing-Tables[^]

and i also learn how to create the report by using pdf template.

now i created the pdf file as template,
http://img33.imageshack.us/img33/8968/openoffices.png

the field name are "txtNo", "txtName", "txtAddress", "txtAmount" and "txtTotal".

what is the concept of looping the table row by using the template? and also i need to have a total of the amount at the bottom of the table. how to get the SUM(amount)?

Please advice me :)
Posted

1 solution

you can use following code to loop in table

C#
TextControl tx = form1.TextControl1;
 int TblID =101;
string cText="Hello";
for (int i = 1; i <= tx.Tables.GetItem(TblID).Columns.Count; i++)
{
     tx.Tables.GetItem(TblID).Cells.GetItem(Row, Col).Text = cText
}
 
Share this answer
 
Comments
melvintcs 9-Dec-12 19:51pm    
may i know what is TextControl? i using VS2008 and i cant find this control..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900