JS Grid provides a High-Performance Robust Grid for Your Most Data-Intensive Input and Data Export Capabilities, including csv, tsv, html, pdf, and xls file types.
Table of Contents
First, developers need to determine that the correct page size is being used, based on country defaults. For example, the most common paper size in the USA is Letter (8.5 x 11 inches), but in the UK it is A4 (8.27 x 11.69 inches).
Second, developers need to ensure that having a large number of columns does not lead to column truncation due to page width limitations. While it’s possible to create hundreds of columns using Ext JS Grid, fitting it on paper for export is another matter. You may be able to squeeze in a few more columns if you rotate the orientation of the page to landscape for the export process.
Third, developers need to define the correct size for columns and the data they contain. This may impact the number of columns that can fit on a page. You need to be very careful using auto or wildcard for column sizes.
Fourth, developers need to consider the font and color styling of headers, table headers, page numbers, and logos. As it’s likely the PDF is going to be printed, do not assume that everyone is using a color printer.
Technology Considerations – Server Side or in the Browser?
The data set size and browser support requirements of your application are two factors that impact your choice in the type of technology used to generate the PDF.
Implementation of Server-Side Technologies
There are dozens of PDF generating libraries available if you are using .NET or Java. Bindings for some of these libraries are available for other server-side languages as well. However, not all of these libraries support the creation of tables. Because we are discussing exporting tabular data, I have created a short list below of PDF generating libraries that have rich table creation capabilities. Not surprisingly, the commercial libraries such as iText have a richer feature set than their permissive open source alternatives.
Languages Officially Supported
|iText||AGPL and Commercial||.NET & Java||iText|
|PDF Clown||LGPL||.NET & Java||PdfClown.org|
|PDFJet||BSD and Commercial||.NET & Java||Innovatics Inc.|
|Boxable (PDFBox)||Apache 2||Java||Open Source / GitHub|
|FPDF||Permissive||PHP||Open Source / FPDF.org|
|pdfmake||MIT||Open Source / GitHub|
|PDFKit||MIT||Open Source / GitHub|
The Ext JS short-term roadmap has enhancements that will allow you to export your Grid data to more file formats (you should continue to use the solution above for PDF). Keep an eye on the blog and release notes for updates. If you use a PDF generation library other than the ones I’ve listed above, please share your thoughts in the comments below.