onlyanarkali
MIS
Hello there...
I am using Crystal 8.5 with sql DB. on my main report, i have a SubReport1 in Details a and SubReport2 in Details b. On SubReport2, I create a Shared variable like this:
When I display it in SubReport2, it displays fine. Now I wanna be able to have this value available in SubReport1 which is in a section above the SubReport2. In the formula below, I wanna be able to replace the stuff after % by the shared numbervar SharedItems2. However the value for SharedItems2 always comes in as zero and it fails saying Division by zero.
So now my doubt is, Can I access a shared variable that is declared in a report placed below the one i wanna use it in. Is it something like trying to use it before its declared or I thot shared variables can be used freely anywhere?
Thanks!
I am using Crystal 8.5 with sql DB. on my main report, i have a SubReport1 in Details a and SubReport2 in Details b. On SubReport2, I create a Shared variable like this:
Code:
whileprintingrecords;
if isnull(Count ({@DateDiff})) then
shared numbervar SharedItems2 := shared numbervar SharedItems1
else
shared numbervar SharedItems2 := Count ({@DateDiff}) + shared numbervar SharedItems1
When I display it in SubReport2, it displays fine. Now I wanna be able to have this value available in SubReport1 which is in a section above the SubReport2. In the formula below, I wanna be able to replace the stuff after % by the shared numbervar SharedItems2. However the value for SharedItems2 always comes in as zero and it fails saying Division by zero.
Code:
if Sum ({Stats_DataEntry.Items}) > 0 then
Sum ({Stats_DataEntry.Items}, {@Description}) % Sum ({Stats_DataEntry.Items}) & "%"
else
"0%"
So now my doubt is, Can I access a shared variable that is declared in a report placed below the one i wanna use it in. Is it something like trying to use it before its declared or I thot shared variables can be used freely anywhere?
Thanks!