Hi All, When I output information to the command line everything is correct. However when I change it to output to a PDF document, I only get the last set of results (I.E. I only get December's results instead of October to December).
Does anyone know what the problem might be?
Thanks in advance!
Oh, here is the code that I am using:
ResultSet reportRS;
Document document = new Document();
try {
// step 2:
// we create a writer that listens
to the document
// and directs a PDF-stream to a
file
PdfWriter.getInstance(document, new
FileOutputStream("testReport.pdf"));
// step 3: we open the document
document.open();
// step 4: we add a paragraph to
the document
document.add(new Paragraph("this is
a test"));
WHEREClause=" WHERE A.UID=B.UID
AND MONTH_EXPIRY=";
WHEREClause = WHEREClause + "" +
thisMonth + " AND YEAR_EXPIRY=";
WHEREClause = WHEREClause + "" +
thisYear + " AND STATUS=1 AND B.TASK_ID=" + TaskReportDetails.taskID;
FROMClause=" FROM USERS A,
USER_TASK_ASSIGNMENT B ";
SQLString=SELECTClause + FROMClause
+ WHEREClause;
System.out.println(SQLString);
reportRS=LDAL.DBQuery(SQLString);
document.add(new
Paragraph("beginning of document"));
try
{
while (reportRS.next())
{
document.add(new Paragraph("for the month of: " + thisMonth));
document.add(new Paragraph("the user: " + reportRS.getString("UNAME")));
System.out.println("thisMonth is: " + thisMonth);
}
}
catch (SQLException se) {
System.out.println("SQL
Exception: " + se.getMessage());
se.printStackTrace(System.out);
}
document.add(new Paragraph("end of
document"));
}
catch(DocumentException de) {
System.err.println(de.getMessage());
}
catch(IOException ioe) {
System.err.println(ioe.getMessage());
}
// step 5: we close the document
document.close();
1
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions
