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

How can I pass field value between subreport and the main!

Status
Not open for further replies.

StefBiz

Programmer
Mar 6, 2003
8
CA
Hello, I'm realy new with this product. I Started this week and I need to produce an invoice for my contract company.

I have my main query to produce my invoice in the main report, and I would like to be able to do a query to get some flags apart of the main query and I would like that the main query can use the value of my subreport query fieldname to do something on the main report!

Is this possible to get a value for another query! I guest this is my question.

Thanks a lot, I realy need to know how I can access query.fieldname value from anywhere in the Crystal report.

Stephane
 
You need to assign your value to a shared variable in the subreport like this:

WhilePrintingRecords;
Shared NumberVar (or StringVar or whatever) YourVariable;

YourVariable := {YourField};

In your main report, you call the shared variable in a section after the section in which the subreport is placed by creating a formula which echoes the first two lines of the above example. It's important to resist calling the variable in the main report until the section with the subreport has fully completed, as the shared variable value will not be updated in the main report until this point.

Naith
 
Thanks Naith for your helpful post. It's working fine now for me. Your advice regarding subreport where they are placed our important was good to know.

Stef
Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top