Jump to content
We've recently updated our Privacy Statement, available here ×
  • Display parameters values in Reports and Ad hoc views.


    Tirupathi Mangalarapu
    • Features: Ad Hoc, Input Controls, Parameters, Reports Version: v8.2 Product: JasperReports® Server

    How can we show parameters for the report or Ad hoc view in the report itself?

    Many customers ask the question: “How can we show parameters for the report or Ad hoc view in the report itself?” and recently one of our solutions consultant engineer came up with this POC project for a prospect and I thought this would be very helpful for all Jaspersoft customers.

    Please follow the steps listed below to display report parameters for each resource type Charts, Crosstabs and Tabular data in reports and ad hoc views. As this was a POC for another customer, this is not fully tested.

    Note: Please ensure that you have done thorough testing before publishing this to production.

    1. Download and install the "adhocparams-0.0.2-SNAPSHOT.jar" file.

      You need to download the Jar file attached to this Wiki.

      Installation:

      After download, extract the jar file and drop adhocparams-0.0.2-SNAPSHOT.jar file into the Tomcat/webapps/jasperserver-pro/WEB-INF/lib/ and restart the Tomcat Application server.

      And, then login to Jasper server and import downloaded exportTemplate.Zip file

    2. Importing "exportTemplate.zip" into Jasper Reports Server: 

      index1_3.png.db97c71621c2fa2014cb19226696f20b.png

    3. Usage, when you want to create a report from an Adhoc View, use the template /public/templates/ShowParameters:

      index2_4.png.5867622a4b369aeb1d93826f14d897d4.png

    index3_2.png.89a9117955d822f12dde5762af74ca5b.png

    This template works for Tables, Crosstabs and Charts.

    The only behavior you might run into is that when you have filters with many values inside, the Chart, Table, and Crosstab could be starting in Page 2.

    As you see on the screenshot, the parameters values do not cover the entire page because it is predefined to be printed on a document:

    index4_0.png.1f7ed76d8498ef3efd2075c3a8e29fac.png

    Hope this helps some customers!

    index1_3.png.7aa06a56b5bee425ef545368676994d1.png

    index3_2.png.91820893475e665f2b2a9d3521968542.png

    index4_0.png.4ee600b899452d36e12709c3c01f3ae4.png

    exporttemplate.zip

    adhocparams-0.0.2-snapshot.jar


    User Feedback

    Recommended Comments

    Hi, This feature does not work properly in JRS v7.1 if the view and its report are placed in organization folder and report is executed by superuser. This is because paths to resources are built differently for superuser than for organization users:

    For Superuser:
    /organizations/organization_1/path/to/resource

    For organization users:

    path/to/resource

    Code in .jar can not locate the resource if superuser executes the report.

    Cheers, Alex

    Link to comment
    Share on other sites



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