Jump to content
Changes to the Jaspersoft community edition download ×

Cloning JasperReport


paullarkin

Recommended Posts

Hi

 

I wonder if anyone can suggest a solution to this problem:

 

I've implemented a reporting service using Jasper and Spring. I need to give users the ability to hide particular columns, and the way that I've done this is to drill down into the JasperReport object's getColumnHeader().getElementByKey(key) methods, and then set the columns' widths and positions accordingly. This is done before filling the report.

 

It all works great, but the problem I have is that Spring seems to cache a single copy of the JasperReport & JasperDesign objects, so that if another user comes along, they see the column settings that the previous user applied. Not good, obviously...

 

My current work-around is to load up a fresh JasperDesign and JasperReport from the .jrxml file each time a query is run. But I'm worried about the performance overhead of this.

 

I think that the way to go might be to have a baseline JasperReport object in memory, and to somehow get a fresh copy of this each time. But I'm a little stuck on how to do that. Any ideas?

 

Also, I was thinking of compiling the .jrxml files using Ant, and then using the .jasper files to load up a fresh report each time. But I couldn't get any of the JasperCompileManager's methods to work with a .jasper URL. Anyone know how to do that, and how much performance that would save?

 

 

Thanks,

Paul

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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