Hi
Crystal Version: 10
Database: SQL Server.
Am having a problem with my shared CurrencyVar Formulas.
I have a main report, which summarises values from 7 subreports. The subreports pass data using shared CurrencyVar formulas.
The sum of each group in the subreport is meant to be passed as a value to the main report. If the group has no entries, then pass ZERO.
My subreport formula (using IFF) are as follows:
WhilePrintingRecords;
IIF (GroupName({table.accountDesc})= 'Travelling', Shared CurrencyVar FINTravel := (Sum ({table.Amount},{table.accountDesc})), 0)
WhilePrintingRecords;
IIF (GroupName({table.accountDesc})= 'Entertainment', Shared CurrencyVar FINEntertain := (Sum ({table.Amount},{table.accountDesc})), 0)
WhilePrintingRecords;
IIF (GroupName({table.accountDesc})= 'Residence', Shared CurrencyVar FINReside := (Sum ({table.Amount},{table.accountDesc})), 0)
etc
I have as many shared formulas as the Number of groups in each subreport
Problem at hand:
The formulas are only passing the value of the last group.
when i view the formulas in subreports they are oK, but when i pass it to the main report, only the value of last group is passed e.g if in the subreport residence is the last group, all values passed will = value of residence
Thus in main report ...
WhilePrintingRecords;
Shared CurrencyVar FINTravel
WhilePrintingRecords;
Shared CurrencyVar FINEntertain
WhilePrintingRecords;
Shared CurrencyVar FINResidence
Travelling Costs 10,000 (incorrect)
Entertainment 10,000 (incorrect)
Residence costs 10,000 (correct)
Please assist!
Crystal Version: 10
Database: SQL Server.
Am having a problem with my shared CurrencyVar Formulas.
I have a main report, which summarises values from 7 subreports. The subreports pass data using shared CurrencyVar formulas.
The sum of each group in the subreport is meant to be passed as a value to the main report. If the group has no entries, then pass ZERO.
My subreport formula (using IFF) are as follows:
WhilePrintingRecords;
IIF (GroupName({table.accountDesc})= 'Travelling', Shared CurrencyVar FINTravel := (Sum ({table.Amount},{table.accountDesc})), 0)
WhilePrintingRecords;
IIF (GroupName({table.accountDesc})= 'Entertainment', Shared CurrencyVar FINEntertain := (Sum ({table.Amount},{table.accountDesc})), 0)
WhilePrintingRecords;
IIF (GroupName({table.accountDesc})= 'Residence', Shared CurrencyVar FINReside := (Sum ({table.Amount},{table.accountDesc})), 0)
etc
I have as many shared formulas as the Number of groups in each subreport
Problem at hand:
The formulas are only passing the value of the last group.
when i view the formulas in subreports they are oK, but when i pass it to the main report, only the value of last group is passed e.g if in the subreport residence is the last group, all values passed will = value of residence
Thus in main report ...
WhilePrintingRecords;
Shared CurrencyVar FINTravel
WhilePrintingRecords;
Shared CurrencyVar FINEntertain
WhilePrintingRecords;
Shared CurrencyVar FINResidence
Travelling Costs 10,000 (incorrect)
Entertainment 10,000 (incorrect)
Residence costs 10,000 (correct)
Please assist!