Jump to content
We've recently updated our Privacy Statement, available here ×
  • Example of Suppressing Headers of Main and Sub Report Elements When Exporting to XLS


    Tom C
    • Features: Exporters, Filters Version: v5.6, v5.5, v5.3, v5.1, v5.0, v4.7.1 Product: JasperReports® Library

    The following Report Export properties are used by the exporters to create default exporter filter instances that filter out content based on element origin information:

    net.sf.jasperreports.export.{format}.exclude.origin.{suffix}.{arbitrary_name}
    net.sf.jasperreports.export.{format}.exclude.origin.keep.first.{suffix}.{arbitrary_name}
    

    Where:   
     {format}is one ofpdf, html, xls, rtf, odt, csv, txt
     {suffix}is one ofband, group, report

    The usage of these properties is discussed in detail in the custom wiki page at /wiki/how-can-i-suppress-page-headers-and-footers-when-exporting-xls

    Starting in TIBCO JasperReports® Server 4.7.1, an addition was made to allow export filter propagated to sub report element. This is in response to a

    need for the export filter to work with Jive enabled report HTML output through report table elements introduced in 4.7.0 release of our product.

    Users will need to add a wild card property setting to reference the original filter in order to make the filter work in main and sub elements of a report.

    For example, to suppress the column header band from the XLS export but to keep only its first occurrence, users need to code the following property:

    net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.3=columnHeader
    

    A new property needs to be added so that the filter applies to all columnHeader bands in all subreports, regardless of their suffix. They are associated by the arbitrary_name.

    net.sf.jasperreports.export.xls.exclude.origin.keep.first.report.3=*
    

    The final setting will look like the following - It is important to keep their arbitrary_name the same (as 3 in this case) or it will not work.

    net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.3=columnHeader net.sf.jasperreports.export.xls.exclude.origin.keep.first.report.3=*
    

    Above only applies the 'keep first band' setting to subreports and table components. If you want the repeating columnHeader removed from subreports (and table components) as well as the main report, then the final setting will look like the following - note the arbitrary_name is the same (as subCol in this case) for the two entries applying to subreports.

    net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.subCol=columnHeader net.sf.jasperreports.export.xls.exclude.origin.keep.first.report.subCol=*
    net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.mainCol=columnHeader
    

    If don't want the first columnHeader either, then you'd swap 'origin.band' for 'keep.first.band' and the final setting will look like the following:

    net.sf.jasperreports.export.xls.exclude.origin.band.subCol=columnHeader net.sf.jasperreports.export.xls.exclude.origin.report.subCol=*
    net.sf.jasperreports.export.xls.exclude.origin.band.mainCol=columnHeader
    

    This new property feature is only available in Jaspersoft product version 4.7.1 and newer. A hot fix package is available for 4.7.0 release – user can download it from the attachment of this article and following the instructions in “readme_hotfix_JRSPro4.7.0_29020.txt” in the zip file to carry out the task.


    TTC-20130630-29020

    hotfix-jrspro4.7.0-29020.zip


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