Crystal Reports 11 R2
I have variable values from subreport in the main report and I want to display total of these values in group header. Is there a way to do that? I couldn't use cross tab nor another subreport to return total value.
//@hours -- subreport formula:
whileprintingrecords;
shared currencyvar hours := sum({table.hours})
//mainreport formulas:
//@reset -- in G2 header
whileprintingrecords;
if not inrepeatedgroupheader then
(shared currencyvar hours := 0;
currencyvar mytotal := 0);
//@accum in G3 header
whileprintingrecords;
shared currencyvar hours;
currencyvar mytotal;
mytotal := mytotal + hours;
//@totalhours -- display formula
whileprintingrecords;
currencyvar mytotal;
@totalhours formula gives correct total if placed in g2 footer, but gives 0 when placed to g2 header.
I have variable values from subreport in the main report and I want to display total of these values in group header. Is there a way to do that? I couldn't use cross tab nor another subreport to return total value.
//@hours -- subreport formula:
whileprintingrecords;
shared currencyvar hours := sum({table.hours})
//mainreport formulas:
//@reset -- in G2 header
whileprintingrecords;
if not inrepeatedgroupheader then
(shared currencyvar hours := 0;
currencyvar mytotal := 0);
//@accum in G3 header
whileprintingrecords;
shared currencyvar hours;
currencyvar mytotal;
mytotal := mytotal + hours;
//@totalhours -- display formula
whileprintingrecords;
currencyvar mytotal;
@totalhours formula gives correct total if placed in g2 footer, but gives 0 when placed to g2 header.