Hi once again.....I somewhat solved my problem.....I am first checking
the size of my arraylist data...if its more than three then I say
writeSelectedRows of 1st three records
then go to a new page and redraw the table from the 4th record by
again calling the my function then I have my signature fields
displayed at the end of the table....Its like this below.....

if(data.size()<=3)
                                {
                        //  All parameters are mainly String Arrays
except the table data is  an ArrayList

writeHeadings(columnnames,aTable,rowspans,colspans,wantSno);
//Write col headings
                      writeData(data,aTable,aligns,wantSno,writer,0);
//'0'  indicates start from 1st row
aTable.writeSelectedRows(0,-1,document.leftMargin(),390,writer.getDirectContent());
                                document.add(aTable);
                                
                                }
                                else
                                {
                                         
aTable.writeSelectedRows(0,4,document.leftMargin(),390,writer.getDirectContent());
//Write 3 rows including headers

                                        document.newPage();
//again created 2nd table and writing from 4th row...redrawing the
table from 4th row
                                        aTable = new
PdfPTable((columnnames[0].length+1));
                        //              aTable.setTotalWidth(500);
                                aTable.setWidthPercentage(100);


                                    aTable.setWidths(widths);
                                        
aTable.getDefaultCell().setLeading(14f,0f);
                                                                    
writeHeadings(columnnames,aTable,rowspans,colspans,wantSno);
//Write col headings
                      writeData(data,aTable,aligns,wantSno,writer,3);
//Write data from 4th row
                          //'3' in the above function indicates row
index(0 index)             
aTable.writeSelectedRows(4,-1,document.leftMargin(),800,writer.getDirectContent());
//writing from 4th row

                                        document.add(aTable);
                                System.out.println("<------------Added
table last rows----->");


                                }


So actually i am redrawing the table and writing the remaining
rows....First I am iterating before hand if my arraylist data is less
than 3 first if condition is satisfied and then I am writing all the
records.....
After the table gets printed ...since this a letter ..I get to print 
conclusion text and the signature fields which i put in a PDFPtable
and added to the document ....With the above logic everything now is
working fine ......."""The whole issue is abt the Signing Authority to
not to sign on a blank page ...atleast he could have last record of
the table on the page he signs'""".....but I have got my own fears

1. If the table data on the second page fills up the page then again
the sign fields appear on the next page that is a blank .I am taking
care of only the first page but the table data which is from database
is dynamic...How could I ensure that the sign fields dont appear on
the blank page...i.e. to take care of  records on all the pages .
2. I actually redrawing the table from 4th record ..again writing col
headings ....I couldnt use writeSelectRows because the second half was
overlapping on the conclusion text. and also I couldnt print col
headings as they part of another function ...I donno whether this is
efficient but please do tell me if there is a better way to accomplish
without redrawing the table ....and also display column headings on
every page....
3...Finally give me some idea about the 'the main issue' mentioned
above...is there a way to accomplish it
Please get back to me as soon as possible

Thanking You 
Ravi Shankar



HI all
I am generating a letter from my application in the form of a PDF
....I have got some text matter  like addresses etc which I am
printing using Paragraph and then i have a Table of data to be printed
before the conclusion text and signature come .I want to split the
Table such that  3 rows come in the first page after the  matter and
remaining rows come on the new page followed by conclusion text and
signature fields for which again using Paragraph.....I am  using
writeSelectedRows of PdfPtable  ...but i see that the conclusion text
and signature fields are overlapping on the table....Actually i am
getting the rowcount and splitting the table ...if it is more than 3
then I  writeSelectedRows(0,3,......); and call document.newPage()
and again I writeSelectedRows(4,-1...); ....I donno whether this is
the way or not ....It isnt working properly ...I cannot see the second
half of the table ..may be I couldnt position it properly...Plz guide
me in this regard as this is urgent and I have to submit this to my
client by Sunday...Thanking you.....
Regards
Ravi Shankar


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to