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

dynamic fields for excel / pdf


madhukiran

Recommended Posts

I am using a single jrxml which executes to give both pdf and excel outputs..

Now I do not want certain fields bands to print when the report is excel. Is there any way to do this??

P.S. I am passing the parameter IS_IGNORE_PAGINATION as true when running excel reports. So,I have give the print when expression to the fields to be hidden during excel generation as

new Boolean(IS_IGNORE_PAGINATION.toString().equals("false")...

but my doubt here is, does IS_IGNORE_PAGINATION default to false or null??? I can see that it is an in built parameter and it should default to false .. but just wanted to confirm....

 

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

When you say "I do not want certain fields bands", is it a band or a field you wish to hide in the output?

Are you hosting this report in your own application or JasperServer? If it is your own, you should be able to detect when the user has chosen an excel output. Then you can declare a boolean Parameter in your design, which could be named something like OUTPUT_IS_EXCELL. This would be false by default, however when you detect a user wants Excel, you could set it to be true.

Using this parameter to you can create PrintWhenExpressions to both bands and fields to your design.

As to your other question, I took a quick peak at the source and it looks like in the JRBaseFiller class there is a method called setIgnorePagination that sets the value of the parameter to Boolean.FALSE if it is not true.

 

Link to comment
Share on other sites

  • 2 weeks later...

Thanks for the reply.. I need to hide the page footer and a logo field in the header actually.. and im using my own application and not a jasperserver...  I ignore pagination only when i export to excel.. so instead of adding a parameter like OUTPUT_IS_EXcel il use ignore pagniation itself in my case .. thanks for the help by confirming that ignore pagination is set to false if not true!!

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