The ability to export a report to various file formats, including PDF, Microsoft Excel, HTML, Rich Text Format and delimited text, is a very important feature of Style Intelligence. In this chapter we will describe how to export a report to the various formats programmatically. We will describe the PDF export in even greater detail.
The process for generating a PDF is the same as printing to a printer through the Java API; however, we need to be aware of font mapping between the java.awt system and the PDF font equivalent. In this chapter, we discuss the default mapping provided with InetSoft products and how to change this default. We also explain how to embed a particular font within a PDF document. We describe how to create PDF bookmarks, and then discuss internationalization issues, particularly how to create PDF documents with CJK (Chinese, Japanese, Korean) characters. Next, we describe the use of the PDFServlet, which can be used to generate a report from a report template, and convert the file format of the report to the supported export formats.
After this we look into exporting to Excel, RTF or delimited text. The process for accomplishing this is similar in each case. We create an output stream and then use the inetsoft.report.io.Builder class to do the actual translation and write the report output to the specified export file format.