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

Using a field value from an unlinked sub-report in the main report 1

Status
Not open for further replies.

Baggers2003

Programmer
Oct 15, 2003
22
0
0
GB
Hi,

I have a main report, which has an un-linked sub report containing one row of data relevent to todays date. I use this report to display last month as text (i.e. January 2004). This works fine un-linked, however I would like to use the value for month in this sub report in the select criteria of another subreport showing cumulative budgets (i.e. {BUDGETSUB.MONTH} <= {DATESUB.MONTH}). This doesn't work for me though as it says &quot;unknown table&quot;.

If I try to create a parameter field in the main report to link to the date sub report then I get the prompt box and this is no good.

What I would like to do is either access the data in one subreport from another, or force the parameter for month and year in the main report to equal the corresponding values in the date subreport (which has only one row), without asking me about it. Then I can use this value to link to my budgets sub-report.

I am using Crystal Reports 8.5.0 over DB2

Anyone got any ideas?

TIA,
Steve.
 
You need to use a shared variable in the subreport to get the value on the main report.

WhilePrintingRecords;
Shared DateVar MyDate:=<<enter date field or expression here>>

Reference this shared variable in a formula in the main report.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top