Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to pass parameters to main report and 2 subreports?
Message
General information
Forum:
Visual FoxPro
Category:
Crystal Reports
Miscellaneous
Thread ID:
00716962
Message ID:
00717091
Views:
21
With the OCX, you should do something like this:
IF THISFORM.cborpt.Value = "127"
	THISFORM.olecontrol1.ReportFileName = ;
		\reports\scaagcystats.rpt"
	THISFORM.olecontrol1.ParameterFields(0) = ;
		"s_date;Date("+s_yr+","+s_mo+","+s_day+");TRUE"
	THISFORM.olecontrol1.ParameterFields(1) = ;
		"e_date;Date("+e_yr+","+e_mo+","+e_day+");TRUE"
	THISFORM.olecontrol1.ParameterFields(2) = ;
		"agency;"+agency+";TRUE"

	THISFORM.olecontrol1.SubreportToChange = "Sub1"  && alias of subreport 
	THISFORM.olecontrol1.ParameterFields(0) = ;
		"s_date;Date("+s_yr+","+s_mo+","+s_day+");TRUE"
	THISFORM.olecontrol1.ParameterFields(1) = ;
		"e_date;Date("+e_yr+","+e_mo+","+e_day+");TRUE"
	THISFORM.olecontrol1.ParameterFields(2) = ;
		"agency;"+agency+";TRUE"
	THISFORM.olecontrol1.SubreportToChange = ""  && back to main

	THISFORM.olecontrol1.SubreportToChange = "Sub2"  && alias of subreport
	THISFORM.olecontrol1.ParameterFields(0) = ;
		"s_date;Date("+s_yr+","+s_mo+","+s_day+");TRUE"
	THISFORM.olecontrol1.ParameterFields(1) = ;
		"e_date;Date("+e_yr+","+e_mo+","+e_day+");TRUE"
	THISFORM.olecontrol1.ParameterFields(2) = ;
		"agency;"+agency+";TRUE"
	THISFORM.olecontrol1.SubreportToChange = ""  && back to main

	testout = THISFORM.olecontrol1.PrintReport
Regards,
------------------
Jose Marcenaro
Tercer Planeta - Argentina
http://www.tercerplaneta.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform