Topic: global variable resets at group change Posted: 06 Jan 2015 at 11:24pm
Hi,
I have some issue with a report and hope you can help me with this ...
The report looks like:
RH
PH
GH1 suppressed
GH2a
GH2b
Da
Db
GF2a suppress formula beneath
GF2b suppress formula beneath
GF1 suppressed
RF
PF
The reason of G2 being a and b is that for each group 2, 2 pages need to be printed (with slightly different informations).
To know which page to print when, I use a global variable swtva which has values 0 to print pages a or 1 to print pages b.
This variable is managed into formulas:
swtva_init placed in RH:
Global NumberVar swtva;
swtva := 0;
swtva_set0 placed in GF2a:
whileprintingrecords;
Global NumberVar swtva;
swtva := 1;
swtva_set0 placed in GF2b:
whileprintingrecords;
Global NumberVar swtva;
swtva := 0;
There are 2 suppress formulas in Section Expert for G2a and G2b sections (H,D,F):
G2a:
Global NumberVar swtva;
if swtva = 1 then true else false
G2b:
Global NumberVar swtva;
if swtva = 0 then true else false
My first issue is that the footers (GF2a and GF2b) never get printed.
My second issue is that, if I delete the formula in GF2a so it's never suppressed, then swtva is correctly set to 1 at the end of GF2a, but is reset to 0 at the beginning of PH, so that the second page never gets printed.
I'm very puzzled here. I'm sure I'm doing something wrong, but can't figure it out.
The new issue is that at each G2 change the report printed switches as well. i.e.
initial group --> report a
next group --> report b
next group --> report a
a.s.o.
I don't know if I went the correct path to achieve my goals being at end: in each G2, print report a and maybe report b if needed.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum