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

Dynamic grp selection using compiled report??


ktrinad

Recommended Posts

By: Vani - olg_v2

Dynamic grp selection using compiled report??

2004-08-18 13:57

Hi,

 

we are using JasperReports in designing reports in PDF format.

 

The report contains certain number of sections and each section contains several static elements as well as dynamic database field elements.

 

Out of these some sections need to be selected for report generation based on some user input.

 

For ex:

 

I need to generate a dynamic pdf report from combination of 12 different sections and each Section is a separate band.

 

When User selection meets condition 1, say

 

Section 1

Section 4

Section 5

 

must be picked.

 

And When it meets condition 2,

 

Section 2

Section 4

Section 6

Section 8

Section 12

 

must be picked up.

 

Some of the sections are a bit complex with multiple columns requiring iterations over a large dataset where as some sections are fairly simple ones with one page reports and mostly contain static elements.

 

Now please suggest me the best way to follow.Is it okay to dynamically generate this xml file at runtime with the sections in the correct order?

 

If I dynamically write xml file based on user selection, I need to compile my report each time I generate the Report which will in turn

degrades the performance.

 

Can someone suggest me a way to use compiled report in selected needed sections and print only the required sections dynamically.

 

Is there a way to specify which sections are to be included without dynamically writing the xml file?

 

Thanks in advance.

 

 

 

By: Mykel Alvis - evilarchitect

RE: Dynamic grp selection using compiled report??

2004-08-19 06:46

Use <printWhenExpression>

 

I do this same thing in a report where the sorting, grouping and accumulation of totals changes but the format stays the same.

 

My personal method is to make a scriptlet function that returns a boolean. The printWhenExpression is called for each section when the <groupExpression> changes.

 

What you need to watch out for is to check that you don't expect JR to call the printWhenExpression UNTIL the <groupExpression> changes.

 

Of course, if you're displaying sections based on detail lines, then you don't have that issue.

 

 

By: Vani - olg_v2

RE: Dynamic grp selection using compiled report??

2004-08-19 08:08

Hi,

 

Thank you for your reply.We very much like the idea of using a scriplet.

 

Can you please provide an example .

 

 

 

 

By: Vani - olg_v2

RE: Dynamic grp selection using compiled report??

2004-08-19 08:10

Refined Question:

============

 

We are using JasperReports in designing reports in PDF format.Our reports are for contract for employment.

 

Contract contains certain number of sections and each section contains several static elements as well as dynamic database field elements.

 

Out of these some sections need to be selected for generation based on user input,say based on country for which contract is generated.

 

For ex:

 

I need to generate Contract from combination of 12 different sections and each Section is in a separate band.

 

When User wants to generate Contract for country say,Asia

 

Section 1

Section 4

Section 5

 

must be picked.

 

And When user wants to generate Contract for country say,Japan

 

Section 2

Section 4

Section 6

Section 8

Section 12

 

must be picked up.

 

Some of the sections are a bit complex with multiple columns requiring iterations over a large dataset where as some sections are fairly simple ones with one page reports and mostly contain static elements.

 

Can someone suggest me a way how to use compiled report in selecting needed sections and printing dynamically.

 

 

Thanks in advance.

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