Please post a small, complete, stand-alone example.

Paulo

> -----Original Message-----
> From: Sparecreative [mailto:zo...@sparecreative.com] 
> Sent: Friday, August 28, 2009 1:48 PM
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] PdfPCell Content no filling entire colspan
> 
> 
> Can somebody please point out what I'm doing wrong.
> 
> I've setup a table with two columns, but I'm having trouble 
> getting content
> to span both columns.
> 
> I add a header across two columns with centered text which 
> works fine, but
> when I add left justified content the copy only occupies the 
> first column,
> but the strange thing is that the colored background is 
> across both columns.
> 
> I've attached the relevant code below:
> 
>             PdfPTable table = new PdfPTable(2);
>             table.setWidthPercentage(100);
> 
>           // this renders fine
>             PdfPCell cell = new PdfPCell(new Phrase("Sample 
> Header Across
> two columns", boldText));
>             cell.setHorizontalAlignment(Element.ALIGN_CENTER);
>             cell.setBackgroundColor(PxsConstants.BASIS32_LIGHT_GREEN);
>             cell.setBorder(Rectangle.NO_BORDER);
>             cell.setPadding(2);
>             cell.setPaddingTop(4);
>             cell.setColspan(2);
>             cell.setBorderWidthTop(2f);
>             cell.setBorderColorTop(Color.BLACK);
>             table.addCell(cell);
> 
>       // the text in these cells only renders in the first 
> column, but the
> background color is across both
>             for(ResponseData result: dataList){
>                 if(new Integer(0).equals(result.getIntegerData())){
>                     cell = new PdfPCell(new
> Phrase(result.getQuestion().getLocalisedDetails(), regularText));
>                     cell.setColspan(2);
>                     cell.setBackgroundColor(cellBack);
>                     cell.setHorizontalAlignment(Element.ALIGN_LEFT);
>                     cell.setBorder(Rectangle.NO_BORDER);
>                     cell.setPaddingLeft(35);
>                     table.addCell(cell);
>                 }
>             }


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
informação confidencial ou legalmente protegida. A incorrecta transmissão desta 
mensagem não significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de 
usar, revelar ou distribuir qualquer parte desta mensagem. 

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
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