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

Detect Export Format Within Report


StevenCrawford
Go to solution Solved by Thomas Zimmer,

Recommended Posts

Is it possible to detect the export format that is currently being used?   I'm wanting to dynamically detect what export format is being used and show or hide report elements based on this.

For example, if the user exports to PDF I wish to show a particular data table but if the instead export to CSV I do not.

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Solution

Have a look at this:

http://community.jaspersoft.com//questions/815695/how-hide-field-print-preview

You can use csv, xls, pdf and others instead of graphics2d in the example above. The elements you want to exclude must have the key <whatever4afilterUneed>

You are also able to filter whole bands in a certain output format: http://jasperreports.sourceforge.net/config.reference.html#net.sf.jasperreports.export.{format}.exclude.origin.{suffix}.{arbitrary_name}

Cheers, Thomas

http://www.thomaszimmer.net

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