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

Subreport Linking Problem

Status
Not open for further replies.

Dodecahedron

Technical User
Oct 27, 2005
69
GB
Hi,

Im using CR10.

I have a main report which is grouped by employee which shows the total for that employee and total for the whole company. There is a graph for each employee in GH1a

GH1b Name Salary Bonus
GF1a Steve 30000 5000
GF1b Totals 10000000 1000000

I am trying to bring in a subreport which is similar to the above report i.e. Graph in GH1a

GH1b Name Insurance Health GF1a Steve 43000 5000
GF1b Totals 40000000 67999999

I link the subbreport on employee name

When I display the report the totals on the subreport = the totals for the employee as below

GH1b Name Insurance Health GF1a Steve 43000 5000
GF1b Totals 43000 5000

How can I resolve this to ensure that the totals come through in the subreport
 
GF1b shows a total for the whole company or a running total?

If it's a running total, you can use a shared variable to track the data. If not, there may be some other things we can do with the linking to get this to work.

What version of Crystal are you using?

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Using CR10

Shows a total for the whole company not a running total
 
I can think of two ways to handle this....

1. Don't "link" the subreport but do include the parameter for the employee name that was created when you linked it. You would then move the total to the report footer and suppress the group headers and footers if the name didn't match what was in the parameter. This will read the entire set of data for each employee - if you don't have a lot of employees, it probably wont' matter much. If it's a large number, this will slow down the report considerably.

2. Add another subreport at the beginning of the report that will get the total numbers and save them to shared variables. (NOTE: You can't suppress the section this subreport is in because it won't run. However, if you make the subreport very small and set the font color to white so that it matches the background color, the data won't actually show when the subreport is run.) Use these shared variables in your other subreports to show the values.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
I think you could create shared variables in a formula that you place in your report header and suppress:

whileprintingrecords;
shared numbervar grtotinsur := sum({table.insuranceamt};
shared numbervar grtothealth := sum({table.healthamt};

Then reference the variables in formulas within the subreport, as in:

whileprintingrecords;
shared numbervar grtotinsur; //etc.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top