Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Problem with shared/global variable Post Reply Post New Topic
Author Message
AdamField
Groupie
Groupie


Joined: 04 Jun 2009
Online Status: Offline
Posts: 88
Quote AdamField Replybullet Topic: Problem with shared/global variable
    Posted: 25 Jan 2010 at 6:14am
Hey Guys,
 
I'm working on a what i first thought would be a simple report...
 
In my report header i have a declaration formula saying :
global numbervar NOT_EDE := 0;
global numbervar NOT_GEN := 0;
global numbervar NOT_MER := 0;
global numbervar NOT_LEU := 0;
global numbervar NOT_ANT := 0;
 
In my detail i have another formula
global numbervar NOT_EDE;
global numbervar NOT_GEN;
global numbervar NOT_MER;
global numbervar NOT_LEU;
global numbervar NOT_ANT;
IF {@Group} = "NOT" THEN
SELECT {allSales.Filiaal}
CASE "EDE" : NOT_EDE := NOT_EDE + {allSales.h_aantal}
CASE "GEN" : NOT_GEN := NOT_GEN + {allSales.h_aantal}
CASE "ANT" : NOT_ANT := NOT_ANT + {allSales.h_aantal}
CASE "MER" : NOT_MER := NOT_MER + {allSales.h_aantal}
CASE "LEU" : NOT_LEU := NOT_LEU + {allSales.h_aantal}
meaning i have 5 shops and in the allSales.filiaal i store my shop and in the h_aantal i have a number
the {@group} field shows what kind of product it was that is on that detail line (computer / desktop / case / and the the NOT case it's a notebook)
so what i count is the number of sold notebooks for every shop
 
so far so good as when i go over the lines i see the counting for the 5 shops go up and the numbers are correct as far as i can see now
 
The problem comes when i try to display the 5 variable's in the report foot (so i can hide the details and only see the totals
i used the folowing formula for that
global numbervar NOT_EDE;
NOT_EDE
but it display's a zero
i was planning on making 4 more formula's for the other shops but when i drag that formula field in the foot part of the report it gives 0's for all the shop's
 
 
any idee what i could be doing wrong
 
or another way i could do this more easy as working with all those formula's knowing that after i get this working for notebooks i should be doing it for about 15 other groups going from TFT's to VGA cards...
 
In the end i would like to make a graphix of those sales per group per shop over a given period of time
 
Tnx for the responce
 
Adam


Edited by AdamField - 25 Jan 2010 at 6:25am
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 25 Jan 2010 at 7:37am
I have issues with global variables,  I always use shared variables instead.
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.017 seconds.