sach411 Posted May 13, 2015 Share Posted May 13, 2015 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,CQuery OutputAcc1Acc2Percent_Acc1_acc2AA100%AB40%AC30%BA20%BB100%BC45%CA33%CB12%CC100% Desired Jasper report OutputAcc1ABCA100%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 More sharing options...
Ankur Gupta Posted May 13, 2015 Share Posted May 13, 2015 Hey, Have you tried using a crosstab, I think that will serve the purpose you need.Hope that this helps. ThanksAnkur Gupta Link to comment Share on other sites More sharing options...
sach411 Posted May 13, 2015 Author Share Posted May 13, 2015 thanks Ankur for the pointer. Will checkout the cross tab option. Link to comment Share on other sites More sharing options...
sach411 Posted May 18, 2015 Author Share Posted May 18, 2015 Thanks Ankur.Using crosstab this was achievable. 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