yoyie yoyie
yoyie yoyie

Reputation: 415

crystal report shared variable from sub report to main report?

in my sub report

shared Numbervar myTotal:= SUM({SP_Project;1.alloted}); 
myTotal; 

and in my main report..a make a formula

shared Numbervar myTotal;
SUM({@byAppro},{@byOffice}) + myTotal;

and i get the right total..but when i make another formula using the same shared variable

shared Numbervar myTotal;
SUM({@byAllo},{@byOffice}) + myTotal;

this time it didn't work..the myTotal becomes 0 which is it should have the same value from the 1st formula..why is that ? is it ? it can only be use once ?

Upvotes: 0

Views: 2732

Answers (1)

Ken Hamady
Ken Hamady

Reputation: 116

The formula that is not working is probably in the same section as the subreport and the formula that IS working is probably in a later section. Formulas are evaluated before subreports when they are in the same section.

You can split the section into A and B subsections, keep the subreport in A and move the formula to the B subsection. That should work.

Upvotes: 1

Related Questions