Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Crystal reports- Calculation between two reports

Hi Experts

I have designed a sales and purchase transaction report using crystal reports and i have designed another report for accounting transactions like Excise Duty payable and receivables, Vat payable and receivables, Expenses(like EB, Maintenance) and so on. Finally I added accounting report as sub-report into First Report.

My question is, is it possible to made some calculations between sub-report and main report.

Hope some solutions from you.





right upto the linking is good?

Right now you have to create a formula (which you might have already done for "Total expenses", you just need to alternate it slightly.


On 2nd report (subreport) You might have a formula like given below.

Instead of Numbervar CAvg, which is the last shown value in the below formula, you have to make it like Shared Numbervar CAvg.

Numbervar TJs;
Numbervar TotalJobs=0;
Shared Numbervar CAvg;
Shared Numbervar CAvg=0;
TotalJobs := DistinctCount({lab_credits.credit_no},{lab_credits.reason_code});  
CAvg:= TotalJobs /{@WorkingDays};
TJs:=TJs + CAvg;

Do your calculation above.

Now in the main report you will create another formula which will look like below.

Shared Numbervar CAvg;
Numbervar TAvg:=fieldname;
Numbervar TotalBoth:= Shared Numbervar CAvg+ Numbervar TAvg;

You will have a reset formula which will be placed ontop of the report header , group header if you are using grouping like this

Shared Numbervar CAvg:=0;
SHared Numbervar TAvg:=0;

bearing in mind that we do not have to declare CAvg field here as it is being shared.

Hope this helps



0 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question