I have a unique question that I am not sure is even possible.
I have a report that has several Group Headers per group. What I would like to do is have select Group Headers (GH1a, GH1p, GH1w…) have an auto incremented number, which I will then turn into an roman numeral using roman(@function). The numbering would be independent on the number of actual groups, only Group Headers. There could be one to 100,000 records (groups) returned to the report but for each record(group) the Group Headers within each group would have select Group Headers numbered the same
EX:
GROUP A
GH1a: I
GH1b:
GH1c: II
GH1d: III
GH1e:
GH1f:
GH1g: IV
GROUP B
GH1a: I
GH1b:
GH1c: II
GH1d: III
GH1e:
GH1f:
GH1g: IV
etc….
Any help would be appreciated. I have tried to use a global variable x in both the report header and each GH that I want incremented using the following code:
in reportheader and/or GH1a //@iCountreset
Global NumberVar iCount:=1;
in each GH that I want incremented //@iCounted
Global Numbervar iCount;
iCount:= iCount+1;
then a second one to romanize it //@RomanCount
roman(@iCounted);
I currently have them hard coded but am trying to combine several rpt files into one where the only difference would be some GH sections would be suppressed and therefore not counted in the numbering.
Thank you in advance.
** edit **
Ryan’s comment was correct. My new approach uses subreports to increment a shared variable, which works.
Steps:
add {@reset} GH1a of ‘main’ report; suppress
create a subreport; place it in GH1b; add these formulae to it:
add to Details section; suppress:
add to Details section:
You will need to add this subreport to each section that requires a Roman-numeral calculation. To make this process a little less painful, export the subreport (‘save subreport as’), then reinsert it.