Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Totals from a Subtotal Report Flowing into a Second Subtotal Report

Status
Not open for further replies.

TheBig1980s

IS-IT--Management
Jun 11, 2007
60
0
0
In a Crystal XI report, I have a subtotal report that shows inventory quantities for each inventory item on the main report. I have placed this subreport onto the main report as a column.

I want to have the main report display a grand total for each amount in this subreport.

In order to try to accomplish this, I added a second subreport that is an exact replica of my "first" subreport. Next, I configured the one field in the second subreport to do a summary.

But, when I place this second subreport in the footer of the report, it prints 0.00 instead of a sum.

What am I doing wrong?
 
Unlink the report from the main report--except for possibly linking parameters to each other and using them the same way in the selection formula area in both main and subreports.

-LB
 
no, that did not work. In fact, I got about 100 amounts printing in one huge block.
 
I guess I'm not clear on what you want to display. If you are able to achieve the correct summaries in the subreport (without linking), then you just have to suppress all sections but the one containing the summaries.

Maybe you should show a little sample of the first subreport and then show what you would expect to see in the second subreport as a summary.

-LB
 
I can't confirm whether the summaries are right....I just know that usually making a summary is the correct way of getting a total.

I just want the report to give me a grand total for all of the amounts in total appearing in each line item of the report where this subtotal appears. I guess Crystal just doesn't allow this without a boatload of programming.

Is this where those shared variables come into play?
 
I got this to work, using shared variables as follows:

In the main report header, add a formula to declare the shared variables:

WhilePrintingRecords;
Shared NumberVar Total;
''

In the subreport
WhilePrintingRecords;
Shared NumberVar Total;
Total := Total + {MyField};
''

In the main report after the subreport
WhilePrintingRecords;
Shared NumberVar Total;
Total

Thanks, for your help and staying in touch with me on this. You once helped me with shared variables and that's what I used thanks to you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top