Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: global variable resets at group change Post Reply Post New Topic
Author Message
rvroth
Newbie
Newbie


Joined: 13 Jul 2010
Location: Luxembourg
Online Status: Offline
Posts: 16
Quote rvroth Replybullet 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.

Any help will be greatly appreciated.

Thanks
rv
IP IP Logged
rvroth
Newbie
Newbie


Joined: 13 Jul 2010
Location: Luxembourg
Online Status: Offline
Posts: 16
Quote rvroth Replybullet Posted: 06 Jan 2015 at 11:38pm
I just solved this issue by changing the formula in GF2a and suppressing GF2b.

formula is:
whileprintingrecords;
Global NumberVar swtva;
//swtva := 1;
if swtva = 0 then swtva := 1 else swtva := 0

But I'm having another issue now ... maybe I'll come back
;)
IP IP Logged
rvroth
Newbie
Newbie


Joined: 13 Jul 2010
Location: Luxembourg
Online Status: Offline
Posts: 16
Quote rvroth Replybullet Posted: 06 Jan 2015 at 11:50pm
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.

Does anyone have an idea?

Thanks
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
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



This page was generated in 0.031 seconds.