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

Preprocessing the records before printing in Jasper report


sach411

Recommended Posts

I have been trying to come up with a simple solution to the problem below.
Given the input parameters, the query returns result which needs to be kind of transposed and displayed in jasper report.
Would be great to get some pointers on same.
 
Input params: Comma separated list of Accounts eg. A,B,C
Query Output
Acc1Acc2Percent_Acc1_acc2
AA100%
AB40%
AC30%
BA20%
BB100%
BC45%
CA33%
CB12%
CC100%

 

Desired Jasper report Output
Acc1ABC
A100%40%30%
B20%100%45%
C33%12%100%

 

 

 

The account list is dynamic i.e. can be more than 3.

Hence the columns will increase as well as the number of rows.

I am trying to put based on following approaches.. however not getting a starting point.

1) preprocessing to be done before printing the results. A variable like ArrayList or Array of integers containing all the elements.. eg. 9 elements in above case.

Then while iterating thr the elements, their positions can be derived and placed in another variable set. (May be object)

And final iteration of new variable will be the report printed.

2) putting scriptlet which will run the query and format the results.

3) Generate the excel first and then apply macro to result.

Unfortunately this is not allowed by users.

Any guidance on the approach is appreciated.

 

 

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

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