##### Exporting report result to different file formats

There are several methods with which JReport Result Bean can export a result file (.rst extension) to different file formats (.htm, .pdf, .txt, and so on):

- Export to HTML
  - exportToHtml(string HTMLFileName)
  - exportToHtml(string HTMLFileName, HtmlParameter Parameter)
  - exportToHtml(string HTMLFileName, boolean bChartApplet, boolean isMultiFile, boolean bUsingTable, boolean bHyperlink, boolean bPageNum, boolean Absolute, int iBrowser)
  - exportToHtml(string HTMLFileName, boolean bChartApplet, boolean isMultiFile, boolean bUsingTable, boolean bHyperlink, boolean bPageNum, boolean bAbsolute, int iBrowser, Drilldownfile)
  - exportToHtml(string RSTFileName, string HTMLFileName, boolean bChartApplet, boolean isMultiFile, boolean UsingTable, boolean Hyperlink, boolean PageNum, boolean bAbsolute, int iBrowser, boolean bincdrilldownfile, boolean noMargin)
  - exportToHtml(string rstFileName, string HTMLFileName, boolean bChartApplet, boolean isMultiFile, boolean bUsingTable, boolean bHyperlink, boolean bPageNum, boolean bAbsolute, int iBrowser, boolean bincdrilldownfile, boolean noMargin, int resolution)
- Export to Page Report Result
  - exportToDhtml(string HTMLFileName)
  - exportToDhtml(string RSTFileName, string HTMLFileName, boolean bChartApplet, boolean isMultiFile, boolean bUsingTable, boolean bHyperlink, boolean bPageNum, boolean bAbsolute, int iBrowser, boolean bincdrilldownfile, boolean noMargin)
  - exportToDhtml(string HTMLFileName, boolean bChartApplet, boolean isMultiFile, boolean bUsingTable, boolean bHyperlink, boolean bPageNum, boolean bAbsolute, int iBrowser, boolean bincdrilldownfile, boolean noMargin, int resolution)
  - exportToDhtml(string HTMLFileName, boolean bChartApplet, boolean isMultiFile, boolean bUsingTable, boolean bHyperlink, boolean bPageNum, boolean bAbsolute, int iBrowser)
  - exportToDhtml(string HTMLFileName, boolean bChartApplet, boolean isMultiFile, boolean bUsingTable, boolean bHyperlink, boolean bPageNum, boolean bAbsolute, int iBrowser, boolean bincdrilldownfile)
  - exportToDhtml(string HTMLFileName, boolean bChartApplet, boolean isMultiFile, boolean bUsingTable, boolean bHyperlink, boolean bPageNum, boolean bAbsolute, int iBrowser, boolean bincdrilldownfile, boolean noMargin)
- Export to PDF
  - exportToPdf(string PDFFileName)
  - exportToPdf(string FileName, PDFParameter Parameter)
  - exportToPdf(string PDFFileName, boolean noMargin)
  - exportToPdf(string PDFFileName, boolean noMargin, boolean isSimPrintMode)
  - exportToPdf(string PDFFileName, boolean noMargin, boolean isSimPrintMode, int isCompressImage)
  - exportToPdf(string RSTFileName, string PDFFileName, boolean noMargin, boolean isPrintMode, int isCompressImage, boolean isTransparent)
  - exportToPdf(string PDFFileName, boolean noMargin, boolean isSimPrintMode, int isCompressImage, boolean isTransparent, boolean bToc, boolean bDrill, string password)
  - exportToPdf(string PDFFileName, boolean noMargin, boolean isSimPrintMode, int isCompressImage, boolean isTransparent, boolean bToc, boolean bDrill)
- Export to Text
  - exportToText(string TextFileName, boolean isNormalText)
  - exportToText(string TextFileName, TextParameter Parameter)
  - exportToText(string TextFileName, boolean isNormalText, int udchWidth, int unchHeight)
  - exportToText(string TextFileName, boolean isNormalText, boolean isRepeat, char delimiter)
  - exportToText(string TextFileName, boolean isNormalText, boolean isRepeat, char delimiter, boolean compress)
  - exportToText(string TextFileName, boolean isNormalText, boolean isRepeat, char delimiter, boolean compress, boolean quoteMark)
  - exportToText(string TextFileName, boolean isNormalText, boolean isRepeat, char delimiter, int udchWidth, int udchHeight, boolean compress, int resolution, boolean quoteMark, boolean hasHeadfoot)
  - exportToText(string TextFileName, boolean isNormalText, boolean isRepeat, char delimiter, int udchWidth, int udchHeight, boolean compress, int resolution, boolean quoteMark, boolean hasHeadfoot, boolean forWindows)
  - exportToText(string TextFileName, boolean isNormalText, int udchWidth, int udchHeight, boolean compress, int resolution)
  - exportToText(string TextFileName, boolean isNormalText, int udchWidth, int udchHeight, boolean compress, int resolution, boolean quoteMark)
- Export to Excel
  - exportToXls(string XLSFileName)
  - exportToXls(string XLSFileName, ExcelParameter Parameter)
  - exportToXls(string XLSFileName, int isWordWrap)
  - exportToXls(string XLSFileName, int isWordWrap, boolean isBiff8)
  - exportToXls(string XLSFileName, int isWordWrap, boolean isBiff8, int param)
- Export to PS
  - exportToPS(string PSFileName)
  - exportToPS(string PSFileName, boolean noMargin)
  - exportToPS(string PSFileName, PSParameter Parameter)
- Export to RTF
  - exportToRtf(string RTFFileName)
  - exportToRtf(string RTFFileName, boolean noMargin)
  - exportToRtf(string RTFFileName, RTFParameter Parameter)
- Export to XML
  - exportToXML(string XMLlFileName, boolean isMultiFile, boolean isOnlyData)
  - exportToXML(string XMLFileName, boolean isDataOnly, string xsdFile)
  - exportToXML(string XMLFileName, boolean isDataOnly)

Parameters

- HTMLFileName - The name of the HTML format result file with a full path.
- bChartApplet - A boolean value which specifies whether or not the chart in an HTML file is an applet. The default value is true.
- isMultiFile - A boolean value which specifies whether or not HTML is generated to a single file or to multiple files. The default value is true.
- bUsingTable - A boolean value which specifies whether or not to use HTML table format when exporting HTML files. The default value is false.
- bHyperLink - A boolean value which specifies whether or not a hyperlink is generated. The default value is true.
- bPageNum - A boolean value which specifies whether or not to generate page numbers. The default value is true.
- bAbsolute - A boolean value which specifies whether the font size is absolute or relative. The default value is true.
- iBrowser - An int value which specifies whether or not the web browser is IE. 0 means IE. The default value is 0.
- Drilldownfile - A boolean value which specifies whether or not to generate the drilldown HTML files in the file list. The default value is false.
- RSTFileName - The name of the result file (.rst extension) that is to be converted to the required format.
- PDFFileName - The name of the PDF format result file with a full path.
- isSimPrintMode - A boolean value which specifies whether or not to use Simulated Printing Mode (true) or Standard Mode (false) (To PDF). By checking the Standard Mode, the exporting speed will be much improved. The default value is false.
- isCompressImage - An int value which specifies the compression ratio of the image in a report (To PDF). The values range from 1 to 100. The default value is 20.
- isTransparent - A boolean value which specifies whether or not to keep the background of the GIF image transparent.
- TextFileName - The name of the Text format result file with a full path. true/false is to set whether this text file is in normal Text format or standard Data format. The standard Data format text file is a text file where each row represents a single record in the report. It can be used as a text datasource for exchanging data with other applications.
- isNormalText - A boolean value which specifies whether or not the text file is in normal text format. When it is set to false, the output format is in standard data format. The default value is true.
- isRepeat - A boolean value which specifies whether or not the same contents are repeated. The default value is false.
- delimiter - A character used in SDF (Standard Data Format) format. The delimiter will only be used when the "isNormalText" parameter is set to false. The default delimiter is a blank space.
- compress - A boolean value which specifies whether or not to remove empty lines or redundant delimiters in the exported text file. The default value is false.
- XLSFileName - The name of the Excel format report result file with a full path.
- PSFileName - The name of the Postscript format result file with a full path.
- RTFFileName - The name of the Rich Text Format file with a full path.
- noMargin - A boolean value which specifies whether or not to generate a file without a page margin. The default value is false.
- chWidth - User defined char width used in plain text format. It would be ignored if the value is 0 or less than 0. When exporting to Text, the default value is -1.
- chHeight - User defined char height which is used in plain text format. It would be ignored if the value is 0 or less than 0. When exporting to Text, the default value is -1.
- XMLFileName - The XML file name.
- isMultiFile - A boolean value which specifies whether XML is generated to a single file or to multiple files.
- isOnlyData - A boolean value which specifies whether or not only the database column information is exported to an XML file. Otherwise, all the report details, including all the properties will be exported. The default value is false.
- parameter - A parameter contains some special settings for exporting to different file formats.
- resolution - An int value which is used to specify resolution for different exported file formats.
- password - A string value which is used to set the password when exporting to a PDF file that contains a password.
- bToc - A boolean value which specifies whether or not to generate TOC for the PDF file.
- bDrill - A boolean value which specifies whether or not to apply drill-down function to the exported PDF file.
- quoteMark - A boolean value specifies whether or not quote characters will be kept in standard format text file.
- hasHeadfoot - A boolean value specifies whether or not page header and footer will be contained when exporting to TEXT.
- forWindows - A boolean value specifies whether the CR-LF in Windows convention or the LF in Unix convertion will be used as the end-of-line character.
- udchWidth - An int value which is specified for each unit of the horizontal density between columns.
- udchHeight - An int value which is specified for each unit of the vertical density between columns.
- isWordWrap - An int value which specifies a word wrap setting option.
  - KEEPORIGIN - Keeps all the original settings of each component's Word Wrap property as specified in the report.
  - NOWORDWRAP - Disables the Word Wrap property for all components.
  - WORDWRAPALL - Enables the Word Wrap property for all components.
- isBiff8 - A boolean value specifies whether or not to export reports to a Data Format file, which means only the report data will be exported without format.
- param - An int value specifies whether or not to include drawing objects in the exported Excel file. If isBiff8 is set to true, drawing objects will not be included in the result file, because they cannot be exported to Data Format files, which means only the report data will be exported without format.
  - NOEXPORTSHAPE - Drawing objects will not be exported to Excel files.
  - EXPORTSHAPE - Drawing objects will be exported to Excel files.
- XSDFile - A string value indicates the schema file on which the exported XML file is based. If it is set to null, a new XSD file will be output.

Notes:

- Method exportToHtml(string HtmlFileName) will use the method exportToHtml(string HTMLFileName, boolean bChartApplet, boolean isMultiFile, boolean bUsingTable, boolean bHyperlink, boolean bPageNum, boolean bAbsolute, int iBrowser) using default parameter values, such as: exportToHtml("HtmlFileName", false, true, false, true, true, true, JRResultViewer.IE).
- Method exportToText(string TextFileName, boolean isNormalText) will use the method exportToText(string TextFileName, boolean isNormalText, boolean isRepeat, char delimiter) using default parameter values such as: exportToText( "TextFileName", isNormalText, false, ' ').