J
John
I want to create a PDF table in Landscape with 16 columns using Java
iText API.
I use class PdfPTable, but it looks like the maximum number of columns
is 12. If I set the
number of columns go beyond 12, then I get ExceptionConverter:
java.io.IOException: The document has no pages.
Is that true?
Here's my code fragment:
Document document = new Document(PageSize.A4.rotate(), 10, 10, 10, 10);
int NumColumns = 13;
try {
PdfPTable datatable = new PdfPTable(NumColumns);
datatable.getDefaultCell().setPadding(3);
int headerwidths[] = {9, 4, 8, 10, 8, 11, 9, 7, 9, 10, 4, 5, 5}; //
percentage
datatable.setWidths(headerwidths);
datatable.setWidthPercentage(100); // percentage
for (int x = 0; x < NumColumns; x++) {
datatable.addCell("hello");
}
document.add(datatable);
}
catch(Exception e) {
e.printStackTrace();
}
Any ideas? Or better approach to my problem? Maybe this is the
limitations of iText API??
Please advice. thanks!!
iText API.
I use class PdfPTable, but it looks like the maximum number of columns
is 12. If I set the
number of columns go beyond 12, then I get ExceptionConverter:
java.io.IOException: The document has no pages.
Is that true?
Here's my code fragment:
Document document = new Document(PageSize.A4.rotate(), 10, 10, 10, 10);
int NumColumns = 13;
try {
PdfPTable datatable = new PdfPTable(NumColumns);
datatable.getDefaultCell().setPadding(3);
int headerwidths[] = {9, 4, 8, 10, 8, 11, 9, 7, 9, 10, 4, 5, 5}; //
percentage
datatable.setWidths(headerwidths);
datatable.setWidthPercentage(100); // percentage
for (int x = 0; x < NumColumns; x++) {
datatable.addCell("hello");
}
document.add(datatable);
}
catch(Exception e) {
e.printStackTrace();
}
Any ideas? Or better approach to my problem? Maybe this is the
limitations of iText API??
Please advice. thanks!!