Jump to content
We've recently updated our Privacy Statement, available here ×
  • How to Display Parameter Value in Ad-Hoc Report


    asimkin
    • Features: Ad Hoc Version: v6.2.1 Product: JasperReports® Server

    Issue Description

    After creating Ad Hoc views with filters and saving them/creating reports, I'd like to show entered parameter values in generated ad-hoc report. How can I do it?


    Resolution

    Filter names map to parameter names in the Ad Hoc report but, because the underlying architecture of an Ad Hoc report is different than that of a report built in e.g. TIBCO Jaspersoft® Studio, the parameter is not found in the adHoc report unit's JRXML. Once the Ad Hoc report is created, you need to do the following to locate the parameterand add it to the report:

    1. Use Jaspersoft® Studio and locate the ad-hoc report unit

    2. Open stateXML.xml file in Jaspersoft Studio

    3. The file should contain a filter expression, something like

      <parameterizedExpressionString>dbo_ORDERS.SHIPCOUNTRY == SHIPCOUNTRY_1</parameterizedExpressionString> 
      

         So, the parameter name in this case is SHIPCOUNTRY_1

    4. Open mainReportJRXML file in Studio and manually create a parameter with the same name, SHIPCOUNTRY_1, 'Is For Prompting' option in unchecked.

    5. Add the parameter to Title band

    6. Save the changes and publish the report to server

    As a result, you get entered parameter value displayed in the report:

    AdHocReport_WithFilter.png.a94de1125cf03ac43e5227666bbbc5b5.png


    Ref. Case 00069390

    AdHocReport_WithFilter.png.de022f4c0f7fd2f84819abea9f200b0c.png


    User Feedback

    Recommended Comments

    Unfortuatnely, it is impossible to achieve the same feature with a template.

    The provided solution depends on parameter name which is generated dynamically, and the solution requires already generated report (that is AFTER template applied) modifications.

    Link to comment
    Share on other sites

    Hi! I have a date input control and in my StateXML it is:
    betweenDates(newSet3.qrpartol_transactions2.FROM_UNIXTIME_SCAN_TIMESTAMP_2, FROM_UNIXTIME_SCAN_TIMESTAMP_2_1, FROM_UNIXTIME_SCAN_TIMESTAMP_2_2).

    How will I create the parameter to display the between - and date?
    Thanks!

    Link to comment
    Share on other sites

    Morning - I have also been trying to identify if it's possible to use date parameters to populate in a report but whatever parameter value I use I get a 'null' value outputting.  Has anyone been able to identify how to make this function work for date values?

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