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

HOW TO USE TEXTBOX,COMBOBOX (VISUAL FOXPRO 6) AS THE PARAMETER

Status
Not open for further replies.

Triplex

Programmer
Oct 10, 2002
43
PH
Hello Again,

I want to use the textbox control or combobox control as the source parameters. Is there a way to do that is visual foxpro instead of using the parameter in crystal report?

For example: I have a combobox for the department Acct.,MIS,SALES if I choice MIS, in the combobox my report will show all the employee in the MIS department.

Is it possible in crystal report 7 to pass the value of the combobox (visual foxpro 6)?

Thanks
Triplex
 
i dont know if its possible in 6 but give this a try
You will first have to have the department field in your combo the bound colum (in your properties set BOUND = .T. and make sure the boundcolumn = colum position you want to pass (ex. Dep = column 1 BOUNDCOLUM = 1)


PARAMETERS reportlocation
public CRApplication
public CRReport

dept = Thisform.combo1.value
reportlocation = 'C:\report1.rpt'


CRApplication = createobject ("CrystalRuntime.Application")
CRReport = createobject ("CrystalRuntime.Report")

*!* Open up the report
CRReport = CRApplication.OpenReport(reportlocation)

CRReport.parameterfields.item(1).SetCurrentValue(dept)






*!* Attach the report to the viewer
Thisform.OleControl1.reportsource = CRReport

*!* View the report
Thisform.OleControl1.viewreport
Thisform.olecontrol1.DisplayGroupTree = .F.
Thisform.olecontrol1.DisplayTabs = .F.
Thisform.olecontrol1.EnableCloseButton = .F.
Thisform.olecontrol1.EnableExportButton = .T.
Thisform.olecontrol1.EnableSearchExpertButton = .T.
Thisform.olecontrol1.EnableSelectExpertButton = .T.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top