trialbyfire
IS-IT--Management
I am trying to pull in negative and positive values from 3 seperate subreports that normally only print the sum of all of the discounts and charges. An example being order charges subreport. May have several lines of discounts and one charge for shipping. I am trying to seperate the values in the subreports and pull two seperate total values into the main report. This appears to be working for the charges but not for the negative values. It is also copying the charge to all of the invoices following the one with the charge. See seperate post "Subreports containing negative and positive values" Rogar was of great help on this subject but I have hit brick wall on the two issues listed above. Here are the formulas I am using. "Note" These are running totals
Subreport Header:
WhilePrintingRecords;
CurrencyVar allowance := 0;
CurrencyVar charge :=0
Subreport Detail:
//These are in two seperate running totals. One for negative value and one for positive value. Formulas are the same for all three subreports with the exception of different running total names and the database file that holds the information.
WhilePrintingRecords;
CurrencyVar charge;
{ar-inv-prt-itm.charge-amount} < 0
WhilePrintingRecords;
CurrencyVar charge;
{ar-inv-prt-itm.charge-amount} > 0
Subreport Footer:
//These are in two seperate running totals. One for negative value and one for positive value. Formulas are the same for all three subreports with the exception of different running total names.
shared NumberVar nNegTotal;
nNegTotal := nNegTotal + {#RTotal0};
WhilePrintingRecords;
CurrencyVar allowance;
shared NumberVar nPosTotal;
nNegTotal := nPosTotal + {#RTotal1}
WhilePrintingRecords;
CurrencyVar charge;
Main Report:
//This is in the fields where I want to populte the sums from the subreports. They are also in two seperate fields.
shared NumberVar nPosTotal;
shared NumberVar nNegTotal;
Any ideas anyone?
Subreport Header:
WhilePrintingRecords;
CurrencyVar allowance := 0;
CurrencyVar charge :=0
Subreport Detail:
//These are in two seperate running totals. One for negative value and one for positive value. Formulas are the same for all three subreports with the exception of different running total names and the database file that holds the information.
WhilePrintingRecords;
CurrencyVar charge;
{ar-inv-prt-itm.charge-amount} < 0
WhilePrintingRecords;
CurrencyVar charge;
{ar-inv-prt-itm.charge-amount} > 0
Subreport Footer:
//These are in two seperate running totals. One for negative value and one for positive value. Formulas are the same for all three subreports with the exception of different running total names.
shared NumberVar nNegTotal;
nNegTotal := nNegTotal + {#RTotal0};
WhilePrintingRecords;
CurrencyVar allowance;
shared NumberVar nPosTotal;
nNegTotal := nPosTotal + {#RTotal1}
WhilePrintingRecords;
CurrencyVar charge;
Main Report:
//This is in the fields where I want to populte the sums from the subreports. They are also in two seperate fields.
shared NumberVar nPosTotal;
shared NumberVar nNegTotal;
Any ideas anyone?