Guys,
Crystal 10.
I have a report with a group. In the footer of that group, I have a subreport. The subreport does some calculations and updates a shared variable.
I want to suprress or display the subreport based on the value of the shared variable. To do that, I'm trying to suppress or display the footer of the group (because that's where the subreport). So, for the footer, I have:
[tt]
shared numbervar x;
if x = 0 then
true;
else
(
x := 0;
false;
)[/tt]
The point is this: if the shared variable is 0, the subreport should not be visible, and thus I must hide the footer of the group in the main report.
The problem is that x seems not to be updated until the next group is printed. In other words, let's say that for the first value in the group, the subreport set x to 50. In the group footer, x appears to be 0, not 50. When the next page (next group value) comes along, x appears as 50 in the group footer. Thus, x is always one group value behind.
I tried iserting another footer section in the in the main report, and bang... in footer b section, I see the correct value of x, but in the footer a, which is where the subreport is, x has the wrong value. I tried evaludateafter, and that didn't work. I also tried, calling a formula in footer b FROM footer a, to see if I got the right value and no luck.
How can I get the updated value so that I could display/suppress the subreport based on x?
Thanks.
JC
_________________________________
I think, therefore I am. [Rene Descartes]
Crystal 10.
I have a report with a group. In the footer of that group, I have a subreport. The subreport does some calculations and updates a shared variable.
I want to suprress or display the subreport based on the value of the shared variable. To do that, I'm trying to suppress or display the footer of the group (because that's where the subreport). So, for the footer, I have:
[tt]
shared numbervar x;
if x = 0 then
true;
else
(
x := 0;
false;
)[/tt]
The point is this: if the shared variable is 0, the subreport should not be visible, and thus I must hide the footer of the group in the main report.
The problem is that x seems not to be updated until the next group is printed. In other words, let's say that for the first value in the group, the subreport set x to 50. In the group footer, x appears to be 0, not 50. When the next page (next group value) comes along, x appears as 50 in the group footer. Thus, x is always one group value behind.
I tried iserting another footer section in the in the main report, and bang... in footer b section, I see the correct value of x, but in the footer a, which is where the subreport is, x has the wrong value. I tried evaludateafter, and that didn't work. I also tried, calling a formula in footer b FROM footer a, to see if I got the right value and no luck.
How can I get the updated value so that I could display/suppress the subreport based on x?
Thanks.
JC
_________________________________
I think, therefore I am. [Rene Descartes]