Hi RG,

You probably want to look at how DataTable in wicket-extensions works.
The idea is you set up an array of column objects, each of which knows
how to display the data in a particular column, and a data provider,
which provides an iterator over the objects represent your rows. The
DataTable puts these two together and renders an HTML table.

You can tackle your PDF problem in a similar way. Create a different
column abstraction that writes to the iText API, then create a component
analagous to DataTable but that writes the PDF out to a stream.
Internally, this DataTable-equivalent would create the iText document,
iterate over the rows returned by the data provider, and for each row
iterate over the columns, asking each column to render its particular
cell.

We use this approach for generating spreadsheets (using POI instead of
iText, of course) and it works like a charm.

jk


On Wed, Apr 16, 2008 at 01:56:43PM -0700, nanotech wrote:
> 
> Hi,
> 
> I have a table displayed in ListView element of wicket and would like to
> generate a PDF using iText API.
> Can someone suggest how to get started with this?
> 
> Thanks,
> RG 
> -- 
> View this message in context: 
> http://www.nabble.com/Wicket-%2B-iText---tp16733269p16733269.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to