Jump to content
  • Embed the AdHoc designer without prompting for a Topic


    Raphaël Peguet
    • Edited on:
    • Features: Domains Version: v9.0.0, v8.2.0, v8.2, v8.1.1, v8.1.0, v8.1, v8.0.3, v8.0.2, v8.0.1, v8.0.0, v8.0, v8, v7.9.1, v7.9.0, v7.9, v7.8.1, v7.8.0, v7.8, v7.5.2, v7.5.1, v7.5.0, v7.5, v7.3.0, v7.3, v7.2.2, v7.2.1, v7.2.0, v7.2, v7.1.3, v7.1.1, v7.1.0, v7.1, v7, v6.9.0, v6.9, v6.7.0, v6.7, v6.6.0, v6.6, v6.5.1, v6.5.0, v6.5, v6.4.3, v6.4.2, v6.4.0, v6.4, v6.3.9, v6.3.1, v6.3.0, v6.3, v6.2.2, v6.2.1, v6.2.0, v6.2, v6.18.1, v6.18.0, v6.18, v6.17.0, v6.17, v6.16.0, v6.16, v6.15.0, v6.15, v6.14.0, v6.14, v6.13.0, v6.13, v6.12.2, v6.12, v6.11.0, v6.11, v6.10.0, v6.10, v6.1.1, v6.1.0, v6.1, v6.0.4, v6.0.3, v6.0.2, v6.0.1, v6.0.0, v6.0, v6, v5.6.2, v5.6.1, v5.6.0, v5.6, v5.5.2, v5.5.1, v5.5.0, v5.5, v5.4.1, v5.4, v5.3.0, v5.3, v5.2.0, v5.2, v5.1.2, v5.1.0, v5.1, v5.0.4, v5.0.3, v5.0.2, v5.0.1, v5.0.0, v5.0, v5 Product: JasperReports® Server

    Use case

    This guide will go through the configuration to embed the Ad Hoc Designer within an application using an iFrame while enforcing the use of a specific Topic. This requires an HTTP source URL pointing directly to the designer, using the Topic's URI as a parameter so that the usual Topic or Domain selection popup is bypassed.


    Resolution

    Only a single file needs to be updated, 'adhocFlow.xml'

    1.  locate the file under `<Path_to_JasperReports_Server>/WEB-INF/flows:
    2. Open the adhocFlow.xml and modify the action-state 'startAdHoc' by changing the transition on `createReport` as follows:
    <action-state id="startAdHoc">
    ...
        <transition on="createReport" to="createEmbeddedReport"/> <!-- change -->
    ...
    </action-state> 
     
    1. Add the definition of the decision-state 'createEmbeddedReport' that we now use in the transition on `createReport`. This can be placed anywhere within the file, but it must be outside the definition of other elements.
    <!-- add -->
    <decision-state id="createEmbeddedReport">
        <if test="requestParameters._eventId == 'startAdHocWithTopic'" then="initForTopic" else="realmsView" />
    </decision-state>
    <!-- add -->
     
    1. Proceed with a server restart.

    iFrame source URL samples:

    Key Points

    • The 'realm' URL parameter value should be the URL-encoded JasperReports Server's path for the Domain Topic or the JRXML topic used as the Ad Hoc designer's source.
    • 'realm' cannot take the path's URI of a Domain, as using it in the Ad Hoc Designer would require additional steps like selecting specific fields and measures, and eventually defining pre-filters.
    • Remember to update the domain and port in the sample links to match your setup.

    Additional Notes

    • A sample modified `adhocFlow.xml` file (based on version 6.1) is available for reference.

    Ref. Case 00061244

     

    adhocFlow.xml


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