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

Creating new instances of JasperDesign or JasperReport


Recommended Posts

Hi!

I have a report which has different sized images. I need to show and reposition this image individually according to their dimension which means that the x,y, width and height of every image will be different.

The first solution came to my mind was dynamically changing the position of the JRDesignImage in the JasperDesign(can be JasperReport obhect as well) object.

The problem is if I set the dimensions of the JRDesignImage element, then that configuration overrides the other element positions as I only have one JrDesignElement for every image. 

Then, I thought that I could create sub reports for every image . Actually this solution is working but every time I need to do an IO operation, create the design or report by file path.

Is there any possibilty for me to load the design once and create new instances of that dynamically ? 

After reading the source code, I figured out that I can do smtg like this : 

JasperDesign design = JRXmlLoader.load("filePath");
JRBaseReport jrBaseReport = new JRBaseReport(design).

but I can not use JRBaseReport while filling the report. Is there any way that I can do that for JasperDesign or JasperReport objects? () I want to create a singleton JasperDesign object and at runtime I want to create 

new instances of that basically..

Or maybe you have another solution for me that I dont need to do this ineffective solution..

Kind regards

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