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

Pass a constant value from subreport to main report

Status
Not open for further replies.

twes3

Programmer
Jun 1, 2004
16
US
Hello all,
I am running on Crystal Reports 10. I have a numeric date that will always be the same that I'm getting from a database field in my subreport. I need to pass this value back to my main report and display it in my page header. Can this be done? If not are there any other options?

example: isodate = 20121031

Thanks for the help
 
Hi twes3

One solution would be to use a Shared Variable to pass data from the sub-report to the main report, but the data is only available in the section following that where the sub report is located. If you want the value available in the Page Header the subreport would need to be in the Report Header (or you would need to place a separate copy of the subreport in the report header).

It is not clear from the example provided what the data type of the isodate field is, and the formulas will vary based on that. Assuming it is a string, create a formula like this in the subreport and place it in the Report Header or Report Footer:

Code:
WhilePrintingRecords;
Shared StringVar IDATE := {Table.Isodate_field}

Then, in the Page Header of the main report, place the following formula:

Code:
WhilePrintingRecords;
Shared StringVar IDATE;


Hope this helps.


Pete.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top