How are you trying to get the Total Price in the subreport? Here's something you can try for getting the information to the main report:
1. Create two formulas that will each initialize a variable. I'll call these {@GrandTotalInit} and {@GroupTotalInit}.
{@GrandTotalInit}
Shared Numbervar GrandTotal := 0;
{@GroupTotalInit}
Global Numbervar GroupTotal := 0;
Note the ":=" - You need to use this syntax to assign a value to a variable. Also, but putting the ";" at the end, this value won't actually display on the report, but the formula will evaluate to set the initial value.
"Shared" means the variable will only be available in the main report, "Global" means it's available in both the main report and the sub-report.
2. Place {@GrandTotalInit} in a report header section in the main report.
3. Assuming that you're grouping data in the main report, put this formula in a group header section above the section where the subreport runs but at the same group level. This will set the variable to 0 at the start of each group.
4. In the subreport, create a formula that will be used to sum the total price. I'll call this {@TotalPrice}:
Global Numbervar GroupTotal;
GroupTotal := sum({myTable.TotalPrice});
GrandTotal
Note that the last line has no ";" on the end - this will display the value of the variable.
5. Put this formula in a report footer of your subreport. This will then display at the end of the subreport.
6. In the main report, create another formula that will sum the values returned from the subreports. I'll call this {@TotalAdd}:
Global Numbervar GroupTotal;
Shared Numbervar GrandTotal;
GrandTotal := GrandTotal + GroupTotal;
7. Place this variable in a group footer section below the subreport and at the same group level as the subreport.
8. Create a final formula which I'll call {@GrandTotalShow}:
Shared Numbervar GrandTotal;
GrandTotal
9. Place this formula in either a report footer section or, if you have multiple groups in the main report, the footer section of a group that is outside of the group where the subreport is located.
-Dell