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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subreport

Status
Not open for further replies.

harding1031

Programmer
Oct 21, 2004
65
US
I have a subreport that have numeric values that I have to summarize. The problem is, I have to dispay the summary values prior to displaying the subreport. How do I get a total for these fields, even thoug they have not been displayed on the report yet. TIA.
 
Not enough details on what you are trying to accomplish in the main report. Is the summary being made in the mainreport? If so, what formulas are you using for the shared variables, etc. In what section is the subreport being processed?


It would also be helpful if you also post your

Crystal Version
Database and connectivity
Sample data
Expected output
Any pertinent formulas

Different Crystal version may have different solutions

 
Crystal version 9.2
ODBC
Main report:
truck id total weitht:
2993 600 lbs-trying to display???

Subreport
bin 1 250 lbs
bin 2 250 lbs
bin 3 100 lbs

In the main report, I need the total weight of the bins in the truck, but the bin info is in a subreport. Currently I have no formulas in the main or subreport. I tried to use a summary field, but it would not let me put it where I needed it. TIA.
 
Option 1

Not sure why you need a subreport

Main report:
Page header
truck id total weight:

Group Header 1
2993 600 lbs-trying to display???

Detail Section
bin 1 250 lbs
bin 2 250 lbs
bin 3 100 lbs

to Get the 600 lbs, all you had to do was insert a sum summary count on weight. Even though it gets placed in the footer, you can move it to the group header.


Option 2

If you insist on a subreport, then

Main report:
Page header
truck id total weight:

Group Header 1 (suppressed)

Detail Section (Suppressed)

Group Footer 1A
2993 600 lbs (Insert SUM summary on weight)

Group Footer 1B
(Subreport inserted here) linked via truckID
bin 1 250 lbs
bin 2 250 lbs
bin 3 100 lbs


Sheers,

-LW
 
Thanks, I think the subreport was used because the bin information is in a table by itself. I am only modifying an existing report. Is there a way that I can sum the values in the subreport and pass that value to the main report using a variable?
 
Yes, use a shared variable, but it's only available to the main report AFTER the subreport fires:

subreport formula:
shared numbervar MySum:= sum({table.value})

In the main use:
shared numbervar MySum

You may need to reset this value depending upon where it's being gathered and for what purpose.

Witchita had asked for:

Crystal Version
connectivity
Sample data
Expected output
Any pertinent formulas

You supplied:

Crystal Version
Database and connectivity
Sample data

I agree with his assessment that a subreport might not be required, and that were you to share the information requested, you might increase performance and decrease complexity.

-k
 
Thanks guys, I think I am going to get rid of the subreport.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top