CR11 and Oracle
Main report has 2 groups
1 = part_no
2 = dept
Subreport has no groups, linked by part_no and dept., sums std_hrs
Subreport formula in Subreport Report Footer called stdhrs:
WhilePrintingRecords;
Shared NumberVar SH := Sum ({PRS.STD_HRS});
Subreport formula in Subreport Report Header called stdhrs_reset:
WhilePrintingRecords;
Shared NumberVar SH := 0;
Subreport is in main section 2a footer
Main formula in section 2b footer called main_stdhrs:
WhilePrintingRecords;
Shared NumberVar SH;
Shared NumberVar MSH := MSH + SH;
Main formula in section 1 header called main_stdhrs_reset:
WhilePrintingRecords;
Shared NumberVar MSH :=0;
This works ok but some part_no/dept have no std_hrs.
It seems when this is true SH keeps the previous value so my total (MSH) is too high.
Main report has 2 groups
1 = part_no
2 = dept
Subreport has no groups, linked by part_no and dept., sums std_hrs
Subreport formula in Subreport Report Footer called stdhrs:
WhilePrintingRecords;
Shared NumberVar SH := Sum ({PRS.STD_HRS});
Subreport formula in Subreport Report Header called stdhrs_reset:
WhilePrintingRecords;
Shared NumberVar SH := 0;
Subreport is in main section 2a footer
Main formula in section 2b footer called main_stdhrs:
WhilePrintingRecords;
Shared NumberVar SH;
Shared NumberVar MSH := MSH + SH;
Main formula in section 1 header called main_stdhrs_reset:
WhilePrintingRecords;
Shared NumberVar MSH :=0;
This works ok but some part_no/dept have no std_hrs.
It seems when this is true SH keeps the previous value so my total (MSH) is too high.