i think i was able to figure it out!!!!!!
in the Main Report:
Created a formula as :
Whileprintingrecords;
Shared NumberVar TotalPrice := sum(MainReportField.TotalPrice)
in the subReport:
Created a formula as :
Whileprintingrecords;
Shared NumberVar TotalPrice1 := sum(Subreportfield.TotalPrice)
In the Main Report:
created another formula:
WhilePrintingRecords;
Shared NumberVar TotalPrice;
Share Number var Totalprice1;
NumberVar GrandTotal;
GrandTotal := TotalPrice + TotalPrice1;
GrandTotal
Dropped it in the footer and both the main and sub report added up.