Jump to content
Changes to the Jaspersoft community edition download ×

Help for dynamic report!

Recommended Posts

By: Tam Nguyen Anh - anhtam

Help for dynamic report!

2002-10-10 02:53

Hi all,

I want to create a dynamic report in my application. I mean that my report will contain some fields which are determined by the parameters I send to in my program by an ArrayList obj. So, those fields are dynamic, sometime they appear in my report, some time do not; that depends on my parameters.

For example: Table T(f1,f2,f3,f4)

My report will show (f1,f2) in some situations, or will show (f1,f2,f3,f4) in others. I also thinked about create some separate .xml files for my particular demand but it's unconvenient because the number of those files is over 10!


May you help me?





By: Teodor Danciu - teodord

RE: Help for dynamic report!

2002-10-10 14:09




Are you talking about hidding or displaying certain

text fields on your report?

Have you tried the printWhenExpresion element

available for each report element?


Thank you,





By: Tam Nguyen Anh - anhtam

RE: Help for dynamic report!

2002-10-11 03:03


Thanks for your instruction, but it doesn't help me.

You see that if you try to hide report elements, you will see on your report some blank areas. So back to my trouble, I have full-field report which display field f1 to field f4; and now if I want to display just field f1 and f3, I must hide the field f2. Consequently, there is a blank area on my report which is reserved for field f2.

I also think about setting the attribute "height" of f2 report element to 0 but I failed (it make the .xml file unwell-formed)

May you help me?





By: Teodor Danciu - teodord

RE: Help for dynamic report!

2002-10-11 13:33




From what I see, all you need is just some very

complicate text field expressions that have

imbricate conditional operators (the ?: operator).


If those expressions tend to be very complicate,

because you have to test various parameters to

decide what value you should bring in the column 2

for example, all you have to do is to transfer them

in a separate class, where you can write and

comment them properly.

In the text field expression you will only make calls

to those convenience methods of your custom



This class could be the scriptlet class itself.

Check the "scriptlet" sample to see how we make

calls to the scriptlet object associated with the

report. In this scriptlet object you have easy

access to the parameters, fields and variables.


I hope this helps.


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