madhup.srivastava Posted January 12, 2013 Share Posted January 12, 2013 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 More sharing options...
mrcaffeine Posted January 13, 2013 Share Posted January 13, 2013 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 More sharing options...
madhup.srivastava Posted January 13, 2013 Author Share Posted January 13, 2013 I am aware of this option, but concern is - say I have 3 sections - Section 1 and 3 section expression returns true while Section 2 returns false. What I am observing on printed report is - there is a white space with same width as Section 2. How can I get rid of that ? Link to comment Share on other sites More sharing options...
mrcaffeine Posted January 14, 2013 Share Posted January 14, 2013 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 More sharing options...
suresh.r_1 Posted November 20, 2019 Share Posted November 20, 2019 hi , this is suresh , Can anyone help me ?Is it possible to create dynamic reports in Jaspersoft Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now