Jump to content
We've recently updated our Privacy Statement, available here ×
  • How to use Ad Hoc report as a subreport


    stasp
    • Features: Ad Hoc Version: v6.2.1

    Use case

    It is sometimes convenient to use existing Ad Hoc reports as subreports for reports created in Jaspersoft Studio.

    Solution

    Starting from JasperReports Server v6.2.1 it is possible to use Ad Hoc reports as subreports by leveraging the com.jaspersoft.jrs.data.source property and pointig it to an Ad Hoc View correspondent to the Ad Hoc report. This property needs to be configured in the subreport JRXML, not in JRXML of the main report:

    com_jaspersoft_jrs_data_source.png.c7135acf4b94813ea04e58bc6f26d260.png

     

    Attached is a working example (it will be imported into /Public folder) here's how it can be replicated:

    - create an Adhoc view and a report
    - copy the report JRXML and set the com.jaspersoft.jrs.data.source property to the path of the Adhoc view
    - for table reports, you currently need to explicitly pass true for a parameter called _AdHocTableFlattenedDS
     
    Note that Adhoc charts currently grow to render on the whole page in the viewer, if the master report page has other elements the chart will likely ruin the layout.
     
    ----------------------
    Ref case #01450923

    export_ad_hoc_subreports.zip


    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...