janemaritz
Technical User
I am using shared variables to return a value from a subreport to a main vendor report. The main report uses a payment detail table with multiple records per vendor. The subreport uses a summary 1099 table with a single record per vendor. The main report displays one line per vendor (the group footer - the detail is suppressed) with a payment subtotal and the 1099 value from the subreport. Since I need to do a calculation on the 1099 value, I'm using a shared variable formula rather than displaying the subreport directly.
I've got the subreport and formulas set up so that the subreport values are showing up correctly, except for the occasional first record on a page. On the odd occasion, the first record shows the subreport value that was just used on the previous page for the previous vendor, and then the second record shows the correct vendor subreport value.
Has anyone else run into 'page break' issues with subreport shared variables?
FYI - Subreport formula (@1099Total) is
Shared NumberVar Total :=
(if isnull({@1099Dividend}) then 0 else {@1099Dividend})+
(if isnull({@1099Interest}) then 0 else {@1099Interest})+
(if isnull({@1099Misc}) then 0 else {@1099Misc})
The subreport is put in the main report group header and is not visible.
I then put the main report (@1099Total) formula in the group footer section b:
Shared NumberVar Total;
My (@Difference) calculation using the subreport value is in group footer section b as well:
{@1099Total} - Sum ({@PaymentsYTD}, {@VendorNumber})
Not sure if this is relevant, but I'm also using a formula (@Run1099Total) to get the report total. I put this formula in group footer section a (suppressed so it is not visible) and in the report footer.
NumberVar RunTotal;
Shared NumberVar Total;
RunTotal := RunTotal + Total;
RunTotal;
Let me know if you need additional info to clarify the problem.
Thanks!
I've got the subreport and formulas set up so that the subreport values are showing up correctly, except for the occasional first record on a page. On the odd occasion, the first record shows the subreport value that was just used on the previous page for the previous vendor, and then the second record shows the correct vendor subreport value.
Has anyone else run into 'page break' issues with subreport shared variables?
FYI - Subreport formula (@1099Total) is
Shared NumberVar Total :=
(if isnull({@1099Dividend}) then 0 else {@1099Dividend})+
(if isnull({@1099Interest}) then 0 else {@1099Interest})+
(if isnull({@1099Misc}) then 0 else {@1099Misc})
The subreport is put in the main report group header and is not visible.
I then put the main report (@1099Total) formula in the group footer section b:
Shared NumberVar Total;
My (@Difference) calculation using the subreport value is in group footer section b as well:
{@1099Total} - Sum ({@PaymentsYTD}, {@VendorNumber})
Not sure if this is relevant, but I'm also using a formula (@Run1099Total) to get the report total. I put this formula in group footer section a (suppressed so it is not visible) and in the report footer.
NumberVar RunTotal;
Shared NumberVar Total;
RunTotal := RunTotal + Total;
RunTotal;
Let me know if you need additional info to clarify the problem.
Thanks!