views:

222

answers:

2

i have a report which looks like this. it will be in PDF format: alt text

the user will input all the different foods, thus every section like NONE, MODERATE, SEVERE will be a different size and thus i need to be able to expand the sections during run time. in order to do that i should probably slice up the image and add different sections during run time. i dont know the proper way to do it.

please help me with a suggestion on how to go about fitting the text in the appropriate sections (but also keep in mind i have no control over how many foods are in each section, the user will decide this during run time)

+1  A: 

It might be worth using a reporting tool rather than iTextSharp for formatted/tabular data?

We use Active Reports from http://www.datadynamics.com/ but I am sure there are others.

EDIT:

It looks like iTextSharp supports html-to-pdf conversion? Maybe thats easier to render?

Just did a search and found this: http://somewebguy.wordpress.com/2009/05/08/itextsharp-simplify-your-html-to-pdf-creation/

Mark Redman
redman thanks but im looking for textsharp solution
I__
+2  A: 

I would create an iTextSharp table for each of your results (None, Moderate, Severe) and write out the table sequentially, in the order you want them to appear on your PDF. Each row in your tables would have four columns.

I found these articles useful for creating tables in iTextSharp:
iTextSharp - Introducing Tables
SourceForge Table Tutorial

Edit
Sorry, I didn't see the vb.net tag on your question. The pages I linked are in C# - I hope you can translate. I found that most of the iTextSharp samples you'll find are in C#.

Jay Riggs