I’m working with a main report and a subreport. The main report is grouped by client account number, then Invoice Month. The details section of the main report contain the invoice details. The subreport contains all of the Credit (payments) detail.
There is already a shared variable that keeps the subreport credit detail with the appropriate Invoice month (group 2). For example, the main report lists all of the invoice information for January 2005, then the subreport prints credit detail for January 2005. It is like this for every month. The shared variable formula for this is:
@ByMonthLink
date(year({RHEADER.INVOICE_DATE}), month({RHEADER.CREATE_DATE}),01)
I placed this formula in the subreport and main report canvas and linked the main and the sub by this formula (@ByMonthLink)
Now what I want to do is total everything up. I already have accurate totals for the amount invoiced by client account number and invoice month as well as a grand total of invoices. I have been trying to pass the totals from the credit detail subreport into the main report as subtotals and a grand total. No matter what section I put the shared variable formula, it displays the total from the group (invoice month) instead of the total credits for all invoice months. My shared variable formulas are as follows:
In the subreport:
@TotalCreditsFromSub1
WhilePrintingRecords;
Shared NumberVar TotalCredits:= sum({RHEADER.TOTAL_DOLLAR})
In the main report:
@TotalCreditsFromSub1
WhilePrintingRecords;
Shared NumberVar TotalCredits
In the main report as a reset of TotalCredits:
@Reset_TotalCreditsFromSub1
WhilePrintingRecords;
Shared NumberVar TotalCredits:=0
I’m sure this all has to do with placment of all three if these formulas but no matter what combination I try, I don’t get the correct totals. After I get a total of the credits for all the months for a client, I then need to do a grand total.
I am using Crystal version 9 with a database that does not use SQL. Also, I tried to include a picture of what my reports look like but they wouldn't paste in. Any and all suggestion would be welcome!!! Thanks!
There is already a shared variable that keeps the subreport credit detail with the appropriate Invoice month (group 2). For example, the main report lists all of the invoice information for January 2005, then the subreport prints credit detail for January 2005. It is like this for every month. The shared variable formula for this is:
@ByMonthLink
date(year({RHEADER.INVOICE_DATE}), month({RHEADER.CREATE_DATE}),01)
I placed this formula in the subreport and main report canvas and linked the main and the sub by this formula (@ByMonthLink)
Now what I want to do is total everything up. I already have accurate totals for the amount invoiced by client account number and invoice month as well as a grand total of invoices. I have been trying to pass the totals from the credit detail subreport into the main report as subtotals and a grand total. No matter what section I put the shared variable formula, it displays the total from the group (invoice month) instead of the total credits for all invoice months. My shared variable formulas are as follows:
In the subreport:
@TotalCreditsFromSub1
WhilePrintingRecords;
Shared NumberVar TotalCredits:= sum({RHEADER.TOTAL_DOLLAR})
In the main report:
@TotalCreditsFromSub1
WhilePrintingRecords;
Shared NumberVar TotalCredits
In the main report as a reset of TotalCredits:
@Reset_TotalCreditsFromSub1
WhilePrintingRecords;
Shared NumberVar TotalCredits:=0
I’m sure this all has to do with placment of all three if these formulas but no matter what combination I try, I don’t get the correct totals. After I get a total of the credits for all the months for a client, I then need to do a grand total.
I am using Crystal version 9 with a database that does not use SQL. Also, I tried to include a picture of what my reports look like but they wouldn't paste in. Any and all suggestion would be welcome!!! Thanks!