-1

I am using itext 2.1.7 library , and want to use that only. However I noticed whenever I create the PdfPTable which has the row headers of the table increase in words , they get scrambled.

For Example , My table header : Total Power For Customer.(Here it gets displayed : Total Powe , r For Customer) , I mean it takes new line after Powe. It cuts the word.

enter image description here

These are the headers for PdfPTable , I have not used any formatting so I am just using ,

Table table = new Table(12);
        table.addCell("Total Power Consumed");
document.add(table);

There are other columns as well! No Special formatting done.

Are there any good formatting options available for itext 2.1.7.(com.lowagie)

However I have used jqgrid as well but jqgrid manages it , if width does not suit it takes new line at adjust it accordingly.

Downvoting for this question does not help , because this is a valid question , I suppose.

Chetan
  • 1,141
  • 2
  • 15
  • 36
  • That's why I keep referring to this blog post: http://lowagie.com/itext2 I'm the Lowagie from com.lowagie; why wouldn't you believe me when I say you should upgrade? – Bruno Lowagie Jun 21 '13 at 11:32
  • Thers is no point in downvoting this post , this question has not asked anywhere on SO. – Chetan Jun 21 '13 at 11:54
  • There's a negative tone saying "I don't want to use a newer iText version that contains bug fixes." There's no http://www.sscce.org/ which makes it impossible for people to reproduce the problem. You don't show us what you've tried. Isn't that raison enough? – Bruno Lowagie Jun 21 '13 at 11:58
  • Here at SO we follow some standard rules to downvote the question , this question is very valid , and show me the link on SO where you kept on saying use newer versions .And you can't force people what to use and what not to , there can be other scenarios as well . I understand newer version are really cool :) – Chetan Jun 21 '13 at 12:01
  • Thise is one of many: http://stackoverflow.com/questions/13515210/difference-between-lowagie-and-itext/13515403#13515403 – Bruno Lowagie Jun 21 '13 at 12:04
  • And then there's this: http://stackoverflow.com/help/on-topic "We feel the best Stack Overflow questions have a bit of source code in them." Your question isn't valid because it just says "it doesn't work." That's not a question, see http://lowagie.com/node/410 What you're trying has worked for ages in iText; you're saying it doesn't work. Maybe you're just a troll. HAND! – Bruno Lowagie Jun 21 '13 at 12:08
  • Have a look at edited question – Chetan Jun 21 '13 at 12:11
  • Still no code sample! Works perfectly when using the latest version. Can't be reproduced using the single line you provide. – Bruno Lowagie Jun 21 '13 at 12:12
  • Take a look at this PDF: http://examples.itextpdf.com/results/part1/chapter04/table_alignment.pdf The "Cell with rowspan 2" is split correctly. Your problem can't be reproduced. – Bruno Lowagie Jun 21 '13 at 12:17
  • can you provide the little source code of it – Chetan Jun 21 '13 at 12:19
  • Surely you know where to find the documentation! If not: http://itextpdf.com/book/chapter.php?id=4 – Bruno Lowagie Jun 21 '13 at 12:22
  • cell.setRowspan(2); method is not available in 2.1.7 – Chetan Jun 21 '13 at 12:34
  • Good luck with your question. I'm not answering anymore. I doubt you'll get an answer from somebody else if you don't change your question: you're not providing a SSCCE, you're not listening to what people say,... – Bruno Lowagie Jun 21 '13 at 12:42

1 Answers1

1

You could try table.addCell("Total Power\nConsumed");

Cryn
  • 1,005
  • 1
  • 9
  • 13