on 05-25-2017 3:36 AM
HI all, I am creating a report with a sub report.
The sub report will pass a value to the same report detail. At the end, I will want to Sum up the value. I have issue adding up the value as I Share the value from the sub report.
Can anyone advise what is the work around?
In my report, I have a group which is "Category". I need to have the sub total of Category and grand total.
My share value in the main report named as "ShareAmt".
My report looking something like this .
I am unable to get the Total amount of 300 and 600 and grand total of 900.
Tried to created another sub report, the sub total for dinner only show 200and the sub total for lunch always show 100 only.
Noticed for total it always only show the last invoice amount.
Please advise.
Thanks!
Hi Mavis,
Assuming "ShareAmt" is the variable that shows the "Amount", here's what you need to do:
1. Modify the ShareAmt formula like so:
shared numbervar amt; //Replace this variable with the shared variable that shows Amount
shared numbervar stot := stot + amt;
amt; //Replace this variable with the shared variable that shows Amount
2. Create a separate formula and place this on Group Footer:
shared numbervar stot;
shared numbervar gtot;
gtot := gtot + stot;
stot;
3. Create a reset formula and place this on the Group Header:
shared numbervar stot := 0;
4. One last formula to show the Grand Total. Place this on the Report Footer:
shared numbervar gtot;
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Anyone can advise on the above. I tried the way Kevin advised but still having the same issue.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mavis,
This is likely to be due to the way Crystal Reports processes objects or better said CR processes some objects before others, so some things get ignored.
Just to clarify: So you are passing a value from the sub-report back to the main report in the same section, correct? Now you want to sum the values in the main report, including the value that you are retrieving from the sub-report?
What section is the sub-report in? Which section do you want the total and grand totals to be in?
Thanks,
Kevin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mavis,
It is hard to say without seeing your report. However, I think that you may need to create a manual running total. Basically, a manual running total consist of 3 formulas, a reset, accumulate and display formulas, and the formulas will looks like:
You can find more about running totals in the CR help. Press F1 in the CR designer and the help will come up.
Thanks,
Kevin
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.