Hi Divya,
Open the shared variable formula in the Main Report and modify it to:
shared numbervar pettycash;
numbervar pc_sum;
pc_sum := pc_sum + pettycash;
pettycash;
Create another formula to show the Grand total and place it on the Report Footer:
whileprintingrecords;
numbervar pc_sum;
-Abhilash