I have a servlet that generates multiple reports that I would like to 
have delivered to the browser but I can't seem to get all of them to 
"appear".  Only the first report I create displays.  So the question is, 
what am I doing wrong?

It is a payroll posting routine, so I generate reports that indicate 
what has and hasn't posted in multiple reports.

Pseudo code is as follows:

Create successful post Document
    PdfWriter.getInstance(successListing, response.getOutputStream());
    initialize first row of datatable as column heading

Create error post Document
     PdfWriter.getInstance(errorListing, response.getOutputStream());
    initialize first row of datatable as column heading


Run posting routines
    Write successes to the success datatable
    Write errors to the errors datatable

Output the documents

if there are errors write them to the datatable
if there are successes, write them to the datatable

Both output routines use the following (two separate methods):

    response.addHeader("Content-Disposition", "inline;filename=" + 
fileName);
    response.setContentType("application/pdf");
    Listing.open();
    Listing.add(Datatable);
    Listing.close();

But I only get one report even though two datatables have been populated.

I have a couple of ideas:

Use only ONE document (a generic "posting" document) by creating a 
single PDFWriter object.  The question is: Can I then open the writer 
and add each datatable to the writer (could be multiple, different 
datatables).  Will they have correct headings, columns and page breaks 
even though they have different formats?  I *think* that is the solution 
but I want to bounce this by you folks before I change the existing 
servlet structure.

Thanks
Pete




------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to