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!

Command Line Parameter

Status
Not open for further replies.

be35g

Programmer
Dec 5, 2000
17
0
0
US
How do I use a command line parameter for record selection:

The following command line:

c:\crfc\crfcntw.exe,recsel

executes the following VB:

Dim Apps As CRAXDRT.Application
Dim Report As CRAXDRT.Report
Dim CrTable As CRAXDRT.DatabaseTable

Private Sub Form_Load()
Set Apps = CreateObject("CrystalRuntime.Application")
Set Report = Apps.OpenReport("C:\CRFC\CRFCNTW.RPT")
Set CrTable = Report.Database.Tables(1)
CrTable.SetLogOnInfo "", "", "uname", "upwd"
Report.PrinterSetup Form1.hWnd
Report.PrintOut (False)
End
End Sub

I have everything working (the command is generated by a process on an AS/400) except I am at a loss as how to pass the recsel parameter to the selection criteria of the Crystal Report. I know how to substring the command line to retrieve the value of recsel, but how to I get that value into my record selection?

Thanks anyone for the help.

Wesley Welsh
wwelsh@greenvillecounty.org
Greenville (SC) County Government

 
Two ways. You could build your formula to use a parameter field and then pass the value of recsel to the parameter. Or you could build (in VB) the entire selection formula and pass it to CR. Just make sure that the formula that you pass is valid in CR syntax.
Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top