You must place this formula somewhere on the subreport canvas.
Then in the main report, create a formula which references the shared variable and does the calculation, e.g., the following would provide a grand total of values from asubreport placed in a group section:
//{@accum} to be placed in the section below the one in which the
//subreport is located (insert if necessary):
...and it gives me a error "A number is required here" ...and it is because of the {.EqTotal} value I want to add along with the other two values from the sub-reports.
The likely problem is that CR doesn't see {SumEqOtherALL;1.EqTotal} as a Number date type. Try using the CDbl or ToNumber function to cast it to a Number:
total := mat + hcost + CDbl({SumEqOtherALL;1.EqTotal});
total := mat + hcost + CDbl({SumEqOtherALL;1.EqTotal});
... I want this ran for each change of group. So i have the formula below in my group footer:
whileprintingrecords;
numbervar total;
Putting these last two formulas in the group footer doesn't work right. The first group is just the ({SumEqOtherALL;1.EqTotal}) value, and the second group is a number i have no clue from.
If i put these formulas in the Report Footer, then the LAST group calculates fine, but the first one doesn't at all.
Obviously, I'm not putting the correct formula in the right spot, or not doing something right here..... any clues?
Simply put, this is what i'm trying to do. I have my Main Report, 2 sub-reports and I will have several groups. I am calculating a total for EACH group from the 2 values pulled from the sub-reports and one value from the main report.
You need to describe your report structure--your groups, the exact locations of the subreports, and the location of the formulas where you are doing calculations using shared variables from the subreports. We should probably also know how you are linking the subreports to the main report.
If you are wanting group subtotals, you need to add a reset formula in the main report group header of the group for which you want the subtotal, as in:
whileprintingrecords;
shared numbervar mat := 0;
shared numbervar hcost := 0;
numbervar total := 0;
Please note that shared variables are only available in report sections below the one in which the subreport is located, so you may have to insert sections to accomplish this.
Has anyone seen this problem? I have a subreport where I am getting a running total for a subtotal of time by a main number for time worked. Then I have formula below that is getting adding all the subtotals together.
WhilePrintingRecords;
Shared NumberVar GrandTotal1;
GrandTotal1:=GrandTotal1+{#RTTime}
In my primary report I have the following.
Shared NumberVar GrandTotal1;
GrandTotal1
The above works fine but when I export it to Excel, it doubles the Grand Total so that if the total is 150 in my report, it becomes 300 on the export. All the other data shows up correctly. Has anyone seen this and is there an answer for it. I'm running Crystal ver 8.5 and Excel XP.
I hope someone else has seen this and there is a logical explanation for the problem.
Please note that shared variables are only available in report sections below the one in which the subreport is located, so you may have to insert sections to accomplish this."
That was my exact problem. I added another footer section, ALONG with a reset formula to my group, and bingo - works great now.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.