Applying a user defined CSS to HTML result file

When exporting a report to HTML format, a .css file will be generated automatically by JReport to control the appearance and layout of the result file. When exporting a report to HTML format with Server API, JReport enables you to apply your own .css file to the HTML result file.

To apply user defined CSS to HTML result file:

  1. In JReport Designer, specify the CSS selector in your own CSS for report objects.

    Select the object which you want to apply in your own CSS, and in Report Inspector, specify a value for the CSS property External CSS Class Selector. The value of the property should be the selector in your .css file.

  2. Publish the report to JReport Server.
  3. Edit your JSP file that invokes the interface used to export the report to HTML format.
  4. Export the report to HTML format using JReport Server.

JReport provides a demo JSP file ApplyUserCSS.jsp which is stored in <install_root>\help\samples\JSPSamples\ApplyUserCSS for your reference. You can copy the whole ApplyUserCSS folder to <install_root>\public_html\jinfonet, then

access the JSP via http://host:port/jinfonet/ApplyUserCSS/ApplyUserCSS.jsp.