Jump to content
We've recently updated our Privacy Statement, available here ×

  • dszeto
    • Features: Ad Hoc, JasperReports Server, URLs, User Interface Version: v8.0, v8.1, v7.5, v7.3, v7.2, v7.1, v6.4, v6.3, v6.2, v6.0.1, v6.0.2, v6.0.3, v6.0.4 Product: JasperReports® Server

    Issue Description

    In TIBCO JasperReports® Server v6.0.1, once we select the data sets for the adhoc view and the system shows the fields, the default option for the creation of adhoc view is set to cross tab.

    How can we change this to default to Table?


    Resolution

    JasperReports Server v6.0.1

    • In 6.0.1 You can modify the following file to set the default report type option to another type (valid types are table, chart, and crosstab):

      jasperserver-proscriptsbower_componentsjrs-uisrcactionModel.primaryNavigation.js

    In this file you should see the following:

    designer: {
        url :    "flow.html",
        params : "_flowId=adhocFlow"
    }
    

    Append &reportType=table to it i.e.

    designer: {
        url :    "flow.html",
        params : "_flowId=adhocFlow&reportType=table"
    }
    

    JasperReports Server v6.2.x, 6.3

    • In 6.2.x and 6.3.0 you can modify the following file to set the default report type option to another type (valid types are table, chart, and crosstab):

      jasperserver-proscriptsadhocdatachooserviewDatachooserDialogView.js

    • Find the original line below (near line 95 or 97 depending on version), and change it to reflect "table" instead of "crosstab"

      reportType = reportType || "crosstab";
      

    Applying changes to your system:

    Testing phase:

    During this phase we will disable JavaScript optimization.

    This step is done to see the result of our modification immediately.

    To disable JavaScript optimization please do the adjustment below:

    • Set the javascript.optimize property to false in the file,  jasperserver-proWEB-INFjs.config.properties.

      # Control default value of javascript optimization in runtime
      javascript.optimize=false
      
    • Shut down JasperReports Server web application.

    • Delete the application server cache.

    • Restart the server.

    Applying changes permanently:

    Disabling JavaScript optimization in the previous step was done only to test our customization. Usage of  non-optimized JavaScript code is not recommended and may cause performance degradation and other undesirable problems.

    To apply the working solution in the production:

    • Rebuild JavaScript code according to the detailed instruction that you can find in the JasperReports Server Ultimate Guide, Customizing JavaScript files chapter

    • Set JavaScript optimization to true:

      # Control default value of javascript optimization in runtime
      javascript.optimize=true
    • After this Application Server should be restarted again to apply the changes to the modified version of optimized JavaScript files


    JasperReports Server v6.4.x, 7.1, 7.2, 7.5

    • Follow instructions above for 6.3 to modify the non-optimized js file (DatachooserDialogView.js).
    • The location of this functionality for the optimized javascript file has changed, therefore applying global optimizations after modifying the non-optimized file above will not work for this change.
    • To modify the optimized javascript, edit (very carefully) the optimized file: jasperserver-prooptimized-scriptsadhocadhocStartMain.js
    • Search for "crosstab" and replace the first occurance with "table" - it might look something like: o=o||"crosstab"
    • Save the file. Even though this is a javascript change, you sometimes may need to clear browser cache, your tomcat temp and/or work folders, and even possibly restart the server to see the change work.

    MJB


    JasperReports Server v8.0.x, 8.1.x

    • Follow the instruction on How to Customize JavaScript files.

    • On the step 5 from this instruction (when you need to customize files) you need to:

      1. Open for editing file jasperserver-ui/ce/jrs-ui/src/actionModel/actionModel.primaryNavigation.js

      2. Find the following code:

        designer: {
            url: 'flow.html',
            params: '_flowId=adhocFlow'
        }
        
      3. Append to "params" a string "&reportType=table", so the result would be

        designer: {
            url: 'flow.html',
            params: '_flowId=adhocFlow&reportType=table'
        }
        
      4. Save this file
    • Continue following instruction on customizing files to deploy new static bundles to the JasperReports Server instance.

    To change the default option from Sample Data, follow instructions here: https://community.jaspersoft.com/questions/958416/adhoc-view-change-default-nodata-option


    Ref. Case 00060270


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