Class Web Report

  • Last update:  2020-12-17
  • 1.Overview

    The FineReport designer can make most reports without coding, but the requirements from clients can vary. Some personalized functions may not able to be realized by the designer. Users can modify the read template through programming, save it as a class web report, and then access the defined class web report on the Web side.

    2.Class Web Report - cpt

    2.1 Define Class Web Report

    The corresponding class of class web report should inherit abstract class com.fr.web.core.Reportlet, implement the method createReport(ReportletRequest arg0) , and return the workbook. Users can read in existing template by specifying the path in the method. Example code here:

    https://github.com/finereport-overseas/example/blob/release/10.0/src/main/java/com/fr/demo/SimpleReportletDemo.java


    2.2 Compile the Class

    Details omitted.


    2.3 Save and Preview

    Place the compiled class SimpleReportletDemo.class under webroot. Place the class under %FR_HOME%\webapps\webroot\WEB-INF\classes\com\fr\demo since the package is under com.fr.demo. Next, start up the server after saving.

    For example, in the default web browser, enter http://localhost:8075/webroot/decision/view/report?viewlet=com.fr.demo.SimpleReportletDemo to view the illustration.

    It just takes the same effect as \WEB-INF\reportlets\doc-EN\Primary\Parameter\Parameter_Reference.cpt

    3. Class Web Report - frm 

    Example code here:

    https://github.com/finereport-overseas/example/blob/release/10.0/src/main/java/com/fr/demo/SimpleFormletDemo.java

    It works the same way as cpt. Here is what it looks like:

    4.Remarks:

    The example in this article reads in the existing templates in the report project. You could use your own template by modifying the path.

    The class web report does not support hot reload. That is to modify the program and recompile, you need to restart the project to take effect. Otherwise, the original template is still displayed.


    Attachment List


    Theme: Secondary Development
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy