Ireport
And
Jasperreport
Generate
Html
Report ProblemsI recently developed a J2EE-based Web project that uses ireport and jasperreport as a Web Report solution. The following problems occur when HTML reports are used for printing.
1. Problem description: After an HTML report is generated using jasperreport, the data is displayed correctly,
Various lines cannot be displayed. (If Chinese characters cannot be displayed, see ireport and jasperreport.
Cause: When an HTML page is generatedJrhtmlexporterparameter. Images_uriIncorrect Parameter settings, mainly due to image Path Problems
Solution:GenerateHtmlThe page can be configured as follows::
Exporter.Setparameter(Jrhtmlexporterparameter. Images_ur, "/Reports/image? Image = ");
/Report/is the directory where the image is located. The image name is "image" without an extension. It has been tested for a long time and it is ineffective to set it to other attributes, you can rename the PX file generated when ireport generates HTML and put it in the/reports/directory.
2. Problem description: After using jasperreport to generate an HTML report, useIEPrintReportVarious lines cannot be printed
Cause: in fact, when jasperreport generates HTML, those lines are a PX-pixel image built in the jasperreports package and displayed in the form of images during ie display, when printing, the browser cannot print these images.)
Print the background color and image, and preview again to display various lines. ÀPrintÀAdvancedÀInternet OptionsÀ solution:SetIE optionsTo print the background color and image. Method: Tool
3. Problem description: when designing a Report Template Using ireport, the standard A4 paper is used,GenerateExcel and PDF are displayed correctly, InGenerateHTML fileThe entire reportMuch smaller than the original size(Complete data display). All data is displayed on one page,Paging unavailable.
Solution: the solution has not been properly solved. Please advise!