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.