1st, I want to initiate a variable in main report like:
Shared numbervar CartonCount:=0;
Then, I wil pass the variable to sub-report and do the calaulation and pass back to main report (these actions will repeat several time because I put the sub-report in details part):
local stringvar a="";
Shared numbervar CartonCount;
if ( (CartonCount = 0) and count ({app_shipping_UnitLoadDetail.header_path}) > 1)
then (
a := "CARTON"+ Totext(CartonCount+1)
CartonCount := CartonCount + count ({app_shipping_UnitLoadDetail.header_path})
a := "-"+"CARTON"+count ({app_shipping_UnitLoadDetail.header_path})
}
However, there is an error message in the highlighted(in red colour) CartonCount indicated by cursor:
"The ) is missing"
Anyone can help me to fix it and tell me if it is correct or not for what I did.
What I want to do is that I want to hv an accumulated a result which proceed the calculation in sub-report and pass it back to main report. Then, the main report run the detail part, the variable will be passed from main report to sub-report again -> calculations -> pass back to main report. (these actions proceed several times)
Thanks * 10000