Jump to content

Jasper report using section approach


madhup.srivastava

Recommended Posts

We have some pre-existing reports where these reports are defined with multiple sections, each sections in turn have various field attributes to display. However, these sections are conditional i.e. based on incoming data value these sections can be displayed or hidden.

We are planning to re-design these reports using Jasper. What will be the recommended approach. How can we define these dynamic sections in Jasper without impacting report output.

Also, I need to make some business logic call (java based) as soon as displayed sections get invoked. Any suggestion for this event based modelling in Jasper ?

 

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Have a look at printWhen expressions which can be used to conditionally show or hide bands (report sections) or even elements (like text fields, charts etc). In there you can add any expression, it has to return true or false. If true is returned, the section is shown, otherwise not. In combination with multiple detail bands this should allow you to implement the flexible layout you wish. In terms of calling external Java Code you need to make sure that the required classes are available for JasperReports, ie that they are in the iReport and JasperReports embedding application's classpath. 

Link to comment
Share on other sites

depends on how you define "section" - i.e. if you could utilize multiple detail bands - one for each section. If you add printWhen to a band then the entire band won't be shown - so there wouldn't be any whitespace. if it is a more complex layout it would be helpful if you'd post a draft of the report/desired output.
Link to comment
Share on other sites

  • 6 years later...

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