Crystal 8.5 linking reports

The technique you want to use is called a Shared Variable. I googled
it and found the following document from Business Objects support. I
have not read this document thoroughly so I don't know how well it
explains the process, but if you can't make sense out of it let me
know. I have used shared variables in the past, but it has been a
while.

Hope this helps.

Brian Stenglein
Clow Stamping Co.

How to Share Subreport Data with the Main Report
The information in the article refers to:
Seagate Info, Seagate Crystal Reports 7

Applies to:

Reported version and higher
Shared variables
Passing data between subreport and main report


Synopsis

A report contains a subreport. Data from the subreport is required for
calculations in the main report.

How can you share subreport data with the main report in version 7 (or
higher) of the Crystal Reports Designer?

Solution


Shared variables, introduced in Crystal Reports version 7, make it
easier to pass values from a subreport to the main report. Using shared
variables requires two formulas: one to store the value in a shared
variable, the other to retrieve the value from the shared variable.

The most important thing to remember when using shared variables is
that Crystal Reports must first evaluate the formula where the value is
stored before evaluating the formula that retrieves the shared
variable.

For example if you want to pass a grand total from the subreport to do
a calculation in the main report, follow these steps:

1. In the subreport, create a formula similar to the one below:

//@SubFormula
//Stores the grand total of the
//{Orders.Order Amount} field
//in a currency variable called 'myTotal'

WhilePrintingRecords;
Shared CurrencyVar myTotal := Sum ({Orders.Order Amount})

2. Place this formula in your subreport.

3. In the main report, create a formula that declares the same variable
name:

//@MainFormula
//Returns the value that was stored
//in the shared currency variable called
//myTotal in the subreport

WhilePrintingRecords;
Shared CurrencyVar myTotal;
myTotal

4. Place @MainFormula in a main report section that is beneath the
section containing the subreport.

NOTE:======

For the shared variable to return the correct value in the main report,
you must place @MainFormula in a main report section that is beneath
the section containing the subreport. This ensures Crystal Reports
evaluates the @SubFormula before @MainFormula.

One way to do this is to insert a section below the section containing
the subreport, and place @MainFormula in this new sub-section:

· On the 'Format' menu, click 'Section'.

· On the 'Sections' list, click the section containing the subreport.

· Click 'Insert' (at top of dialog box). This inserts an additional
subsection.

· Click 'OK' to return to the report, and insert @MainFormula into this
new sub-section.

The next time you preview the report, @MainFormula displays the value
from the subreport. In this particular example, that value was the
grand total of the {Orders.Order Amount} field.

============

5. Once you have verified that @MainFormula is returning the correct
value from the subreport, you can include this formula in other main
report formulas, such as:

//@NewFormula
//includes data from subreport

{@MainFormula}+ Sum ({Customer.Last Year's Sales})

· Place this formula in the same section as @MainFormula, or in a
section further down on the report.


You have now successfully shared data from a subreport with the main
report.




--- In vantage@yahoogroups.com, "wipaire_vantage" <vantage@...> wrote:
>
> I need some help. I'm running Vantage 6.1. I'm modifying the AgedAR
> report in crystal. I'm linking in the Customer table through ODBC
and
> a Subreport based on CustomerID. I would like to return the Country
> field back to the main report to do some additional calculations
based
> on which country the customer is in. Please let me know if you can
> help.
>
> Thanks
> Joe
>
I need some help. I'm running Vantage 6.1. I'm modifying the AgedAR
report in crystal. I'm linking in the Customer table through ODBC and
a Subreport based on CustomerID. I would like to return the Country
field back to the main report to do some additional calculations based
on which country the customer is in. Please let me know if you can
help.

Thanks
Joe
I might be able to help you can send me a direct email to the address
below.

Innovative Office Products, Inc.
Frank Zeigafuse
General Manager
610-559-6369
fzeigafuse@...


-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of wipaire_vantage
Sent: Thursday, March 30, 2006 2:43 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Crystal 8.5 linking reports


I need some help. I'm running Vantage 6.1. I'm modifying the AgedAR
report in crystal. I'm linking in the Customer table through ODBC and
a Subreport based on CustomerID. I would like to return the Country
field back to the main report to do some additional calculations based
on which country the customer is in. Please let me know if you can
help.

Thanks
Joe





Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must
have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder
and Crystal Reports and other 'goodies', please goto:
http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto:
http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto:
http://groups.yahoo.com/group/vantage/links
Yahoo! Groups Links