I got a table with columns like
and would like to have a report on this table with the column heading depending on the actual year:
J0 should have the heading 2019
J1 should have the heading 2018
J2 should have the heading 2017 ...
J0 should have the heading 2020
J1 should have the heading 2019
J2 should have the heading 2018 ...
What type of "report" are we discussing?
Actually I'm on apex 5.1.3 and as report would be best an IG.
It's not super elegant, but I am not sure how you could resolve this without the use of a page item per column, and have these items populated with your logic.
So your column headings would look like: &PX_J01. , &PX_J02., &PX_J03.,&PX_J04. etc..
And you would have a Before Header Page Process that sets the values of these items, something like:
: PX_J02 :=to_char(sysdate,'YYYY')+1;
Thx mskamene, nice idea and it works fine.
For calculating the column headings I used something like:
SELECT TO_CHAR(SYSDATE, 'YYYY') - Z0, TO_CHAR(SYSDATE, 'YYYY') -Z1, TO_CHAR(SYSDATE, 'YYYY')- Z2 , TO_CHAR(SYSDATE, 'YYYY')- Z3 , TO_CHAR(SYSDATE, 'YYYY')- Z4
INTO :P12_J0 , :P12_J1 , :P12_J2 , :P12_J3 , :P12_J4
,SUBSTR('J0', 2) Z0
,SUBSTR('J1', 2) Z1
,SUBSTR('J2', 2) Z2
,SUBSTR('J3', 2) Z3
,SUBSTR('J4', 2) Z4
, TO_CHAR(SYSDATE, 'YYYY')
with J0, J1, J2, J3, J4 as the original column names in the subjacent table.