Acc1 | Acc2 | Percent_Acc1_acc2 |
---|---|---|

A | A | 100% |

A | B | 40% |

A | C | 30% |

B | A | 20% |

B | B | 100% |

B | C | 45% |

C | A | 33% |

C | B | 12% |

C | C | 100% |

Acc1 | A | B | C |
---|---|---|---|

A | 100% | 40% | 30% |

B | 20% | 100% | 45% |

C | 33% | 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.