As shown in the above, to create a new HTML page, define a toolbar and a iframe, pictured above defined in the toolbar button, iframe embedded in FineReport statements, the diagram below:
FineReport statements set
Open the designer, to find the one embedded in a web page template above, because want to use a custom button as a toolbar, then the built-in toolbar FineReport statements need not displayed, click the template & gt; Template web properties & gt; Paging preview set, remove the use the toolbar at the front of the check, the diagram below:
Custom export button
Nine custom Web page defines the export button, so how to achieve export operation?
FineReport JS interface for export operation:
Export PDF: exportReportToPDF ()
Export/Excel (paging) : exportReportToExcel (' page ')
Export (Excel) (as) : exportReportToExcel (' simple ')
Export/Excel (pagination sheet) : exportReportToExcel (' sheet ')
Export (paging export XLS format), Excel exportReportToExcel (' page_isExcel2003)
Export (Excel) (the same export XLS format) : exportReportToExcel (' page_isExcel2003)
Export (Excel) (pagination sheet export XLS format) : exportReportToExcel (' page_isExcel2003)
Export [images] : exportReportToImage (' GIF ') [inside the parentheses can change the parameters, such as PNG, JPG, and so on picture type]
Export [word] : exportReportToWord ()
Therefore, the application of each button click event called the JS interface to implement the corresponding export formats, such as export PDF, so the time for the button's onclick:
Onclick="document. The getElementById (' reportFrame). ContentWindow. The contentPane. ExportReportToPDF ()", "
Docment. GetElementById (' reportFrame) is to obtain the iframe framework, and then through contentWindow report window, and got the contentPane this report container, finally you can call the various export interface method from the container,
Several other button export events not explained, one
The complete code
According to the same method as above for several other button to add an export, complete code is as follows:
Copy the code
<meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "/& gt;
<body>