Matrix report in Apex
I have come across a tricky situation and would need the assistance of Apex community members here.
I would require to build a matrix report in Apex over a table containing 2 columns and about 500 rows.
The matrix report should be of 20 X 25 (col X rows) format to display the entire data in the table.
Please consider the sample data below containing 15 rows and 2 columns
Table A
Col_data Col_status
abc up
bcd up
cde up
def up
efg down
fgh up
ghi up
hij up
jkl up
klm up
lmn up
mno up
nop up
opq down
pqr up
Now this table data needs to be displayed as a matrix report of 3 X 5.
The idea here is to only display the col_data to the end users.
The col_data text would be coloured as red or green depending on the col_status as up or down respectively.
Conditional html formatting needs to be applied in this case.
The problem here is we don't have matrix report in Apex. This needs to be achieved in sql query.
While generating a matrix report using sql query, we can select only one column and the status column is missed out.
Hence the data required for conditional formatting ( colouring) is not even selected if we generate a matrix report using sql query.
Any help or alternative approach here would be greatly appreciated.