Jump to content
JasperReports Library 7.0 is now available ×
  • Define Table footer dynamically for the Report using the Print When Expression Property


    Prasad B
    • Version: v8 Product: Jaspersoft® Studio

    We can define the Table footer dynamically according to the value of the parameter of the sub report.

    The steps to create the dynamic footer are as follows:

    1. Create a report using a foodmart sample dataset. Create one parameter of type boolean for the report. (In the demo, I have defined it as ShowFooter").

    2. Create a table using a sub-dataset. In the demo, the name of the dataset is Table_Data. Create one parameter for the sub-dataset. In the demo, I have defined it as "ShowTableFooter".

    3. You need to pass the value of the main report parameter to the sub dataset parameter as an input. It can be defined inside the Parameter tab of the Dataset field of table properties. Please refer to the Parameter_Mapping.jpg for more details.

    4. Once this has been defined, you need to define the Print When Expression of the Table Footer. Here, you need to pass the parameter of the sub dataset. So, it will work according to its value.

    5. So, the flow of the report is as below:
        -- When you load the report, it will ask for the value of the parameter of the main report (ShowFooter). When you define this value, it will work as an input for the parameter of the sub dataset (ShowTableFooter). This parameter is used for the input of the table footer. So, the result will be as per the value of the main parameter (ShowFooter).
        
        
    --  I have attached the sample jrxml file for your reference.

    table_footer_demo_11_april.jrxml


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...