Jump to content
We've recently updated our Privacy Statement, available here ×
  • How to Limit Export Formats for Dashlets


    asimkin
    • Features: Dashboards Version: v7.1 Product: JasperReports® Server

    Use Case

    Customer would like to limit the export formats (PDF, Excel, CSV etc) available for dashlets but couldn't find a way to achieve it.


    Resolution

    By default, TIBCO JasperReports® Server v.7.1.0 supports the following export formats:

    PDF

    Excel (Paginated)

    Excel

    RTF

    CSV

    ODT

    ODS

    DOCX

    XLSX (Paginated)

    XLSX

    PPTX

     

    Thj list of formats is code in a Javascript file:

    webappsjasperserver-proscriptsbower_componentsbi-dashboardsrcdashboardviewbasecomponentViewTraitreportTrait.js

    Export formats defined as:

      exportOptions = [
                {
                    label: i18n['jasper.report.view.hint.export.pdf'],
                    action: 'pdf',
                    params:{outputFormat: "pdf"}
                },
                {
                    label: i18n['jasper.report.view.hint.export.excel'],
                    action: 'excel',
                    params:{outputFormat: "xls"}
                },
                {
                    label: i18n['jasper.report.view.hint.export.excel.nopag'],
                    action: 'excel.nopag',
                    params:{outputFormat: "xls", ignorePagination: true}
                },
    ...
    
    

    Unfortunately, there is no UI or a config file to limit the list of export formats.

    The only way is to change the Javascript file and comment unrequired formats, like

    /***
                {
                    label: i18n['jasper.report.view.hint.export.excel.nopag'],
                    action: 'excel.nopag',
                    params:{outputFormat: "xls", ignorePagination: true}
                },
    ***/
    

    Please note, that all dashlets will be affected by the changes.

    support_dashletexportformats.png.ff875d98294db4d4d54c9bd8d30bd409.png

    By default, JasperReports Server uses optimized versions of scripts located in folder

    webappsjasperserver-prooptimized-scripts

    In order to test the changes, you can add ?_opt=false parameter to URL to load non-optimized scripts and check if the changes meet your requirements:

    https://community.jaspersoft.com/wiki/can-i-test-customizations-jasperreports-server-javascript-running-optimization-process

    If everything is OK, you should re-generate optimized scripts as described in JasperReports Server Ultimate Guide:

    https://community.jaspersoft.com/documentation/tibco-jasperreports-server-ultimate-guide/v710/customizing-javascript-files

    Solution tested with TIBCO JasperReports® Server v.7.1.0


    Ref. Case 01667711



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