(Keep in the mailing list) 

> -----Original Message-----
> From: Wayne Schoeman [mailto:[EMAIL PROTECTED] 
> Sent: Monday, August 29, 2005 11:03 AM
> To: Paulo Soares
> Subject: Re: [iText-questions] pdf tables - how to resize?
> 
> Hi Paulo
> 
> what i was tryingto do was :
> 
> 1) normally one would write a table with column's and row's correct?
> from left to right
> ok i did this - but with the amount of columns i had (32) it displays
> about 3 characters a cell and I need to fit a max of 11- thus my need
> to scale the Object
>  
> what i did was i read my data from my database into vectors 1-32
> I added these Vectors to a main vector "monitoring"
> eg 
> 1st Vector
> timeVec.elementsAt(0) is "TIME :" 
> timeVec.elementsAt(1) is "10:32"
> timeVec.elementsAt(2) is "11:00"
> 2nd Vector
> dayVec.elementsAt(0) is  "DAY :" 
> dayVec.elementsAt(1) is  "mon"
> dayVec.elementsAt(2) is  "tues"
> 
> now what i do is read the data in with the following method wich
> writes the Table as
> this method>
>  y=monitoring.size()-1;
>            // System.out.println(y);
>             
>       for (int b = 0; b<=y; b++) {
>             addToTable(monitoring.elementAt(b));
>             } 
>  
> call's this one>
> public void addToTable(Object vec){
>        int y=((Vector) vec).size();   
>        for (int b = 0; b<y; b++) {
>        table.addCell((String)((Vector) vec).elementAt(b));
>        System.out.println("herew :"+((Vector) vec).elementAt(b));
>        if(b=0){
>                       table.getDefaultCell().setGrayFill(0.9f);
>                       System.out.println("111111");
>                       
>               }
>               else{
>                       table.getDefaultCell().setGrayFill(0.0f);
>                       System.out.println("-2");
>               }
>        }
>     }
> 
> ok this works now so now i have my column headers on the left instead
> of @ the top  . except that when i try tyo set the column widths it
> dont do it ? there is something im doin wrong?
> code below:
> // monitoring loop
>             int monitoringColumns=monitoringInt+1;
>             //System.out.println(monitoringColumns);
>             monitoringtable = new PdfPTable(monitoringColumns);
>               int headerInt=11;
>               int []headerwidths =new int[monitoringColumns];
>             for(int i=0;i<monitoringColumns;i++){
>               headerwidths[i]=headerInt;
>               //System.out.println(headerwidths[i]);
>             }
>             monitoringtable.setWidths(headerwidths); 
> //end monitoring loop
> 
> if i do the System.out.println(headerwidths[i]);
> it gives me 11 x amount of times but it doesn't set the 
> column widths - 
> 
> a) the problem was that i do not know how to set the Font size of the
> data inside the table

PdfPTable.addCell(Phrase)

> b) i want to scale the size of the table - i want to be able to put it
> into a specific rectangle on the page
> 

PdfContentByte.transform(). You must place the table at an absolute
position. See the tutorial.

> I have some more queries - but i will wait with them.
> 
> Thanks
> 
> 
> 
> 
> 
> 
> 
> On 8/28/05, Paulo Soares <[EMAIL PROTECTED]> wrote:
> > What's your data formating problem?
> > 
> > ----- Original Message -----
> > From: "Wayne Schoeman" <[EMAIL PROTECTED]>
> > To: <[email protected]>
> > Sent: Friday, August 26, 2005 1:39 PM
> > Subject: [iText-questions] pdf tables - how to resize?
> > 
> > 
> > Hi 
> > 
> > I created a table with 32 colums- the problem i have is 
> that there is
> > not enough space on a A4 page to fit all these Colums into readable
> > data what happens is this eg
> > 
> > col        col
> > um        um
> > num      num
> > ber1      ber2
> > 
> > this is the way the text get's wraped - i need to be able to either
> > resize the text to view the text as Column1,Column2 etc.
> > or I want to be able 2 write the column headers vertical 
> and write the
> > rows vertically aswell ie
> > 
> > Column1 -   Please      Please
> > Column2 -   Help         Help
> > Column3 -     I             I have
> > Column4 -   am           lost
> > Column5 -   lost          my mind
> > 
> > I can create the pdf Documnet but am having so hassels 
> formatting the
> > data - please could someone give me some advice.
> > 
> > Thanking you
> > Wayne
> > 
> > 
> > -------------------------------------------------------
> > SF.Net email is Sponsored by the Better Software Conference & EXPO
> > September 19-22, 2005 * San Francisco, CA * Development 
> Lifecycle Practices
> > Agile & Plan-Driven Development * Managing Projects & Teams 
> * Testing & QA
> > Security * Process Improvement & Measurement * 
> http://www.sqe.com/bsce5sf
> > _______________________________________________
> > iText-questions mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/itext-questions
> >
> 


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to