Below Is My crystal report structure (shown in Image) ,I am using below formula to get Fee Total
If{DataTableDoctorInfo.Fee_Unit}="Percent" Then
formula = ({DataTableDoctorInfo.Fee}/100)*{DataTable1.Number of Patient}
Else
formula={DataTableDoctorInfo.Fee}*{DataTable1.Number of Patient}* Sum ({DataTableDrmonthlyData.Payable Amount})
End If
now I also want to add sub total In my formula which i am getting In my subreport
from column having sum
of that column values ,Now I want to use this sum in above formula something like this
formula = ({DataTableDoctorInfo.Fee}/100)*{DataTable1.Number of Patient}* {that sum value which I am getting in sub report}
DrMonthlySubRepoPatient
is My sub report shown in image in section 3
,How I can achieve this ?
I tried this code in Main report
formula of FeeTotal
WhilePrintingRecords;
Shared CurrencyVar myTotal;
myTotal :=myTotal;
If{DataTableDoctorInfo.Fee_Unit}="Percent" Then
formula = ({DataTableDoctorInfo.Fee}/100)*{DataTable1.Number of Patient}* myTotal
Else
formula={DataTableDoctorInfo.Fee}*{DataTable1.Number of Patient}* Sum ({DataTableDrmonthlyData.Payable Amount})
End If
and this formula in subreport fo Payble amount field
WhilePrintingRecords;
Shared CurrencyVar myTotal := Sum ({DataTableDrmonthlyData.Payable Amount})
but its giving following error,How do I resolve it?
`The remaining Text does not appear to be part of the formula `