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

Using parameters from main report in a formula on subreport.

Status
Not open for further replies.

Icebun

MIS
Jul 31, 2002
19
GB
I have a report containing a main report and a subreport.

Users enter a year and a month on the main report. This is used to calculate financial information in two columns :

1. a current month total (for the month and entered)
2. a cumulative total (for all months up to and including the month entered).

I have the same two fields on the subreport, but when I run the report, the values on the subreport are blank.

I am using shared variables to pass the month from the main report to the sub report.

Code in main report :

whileprintingrecords ;
shared numbervar mth ;
mth := {?Month} ;
mth;

(?Month is the parameter field)

Code on sub report :

whileprintingrecords ;
shared numbervar mth;
mth;

I then use the variable 'mth' in my formulae on the subreport.

Any ideas ?




 
Which section contains the formula in the main report?
Which section contains the formula in the subreport?
Which section contains the subreport?

A better approach would be to create the same parameter in the subreport and link this to the main report parameter. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Please ignore original message - now sorted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top