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

refreshing parameters

Status
Not open for further replies.

vz

MIS
Jul 31, 2001
131
US
when i run my report in vb it does not have an option to refresh my report is there a way where i could get it to prompt me for new paramters every time its run.
thanks
 
You can also set up your VB app to prompt for the parameters. For example, if you have several reports that require a date to be entered as the parameter, you can add radial buttons to a form with the report names for each. Add a data entry control to the form for the user to enter the date (ie. a masked edit box or a month view with dtpicker). And then a command button to execute the report. Add a Crystal Report to your app for each report that is linked to the radial button. Then when the user selects a report by selecting the radial button, enters a date and clicks the command button the app will determine which report to generate, evaulate the date entered and pass it to the report as the parameter.

Here is an example of code you might use:
dim sDate

sDate = Right$(mskDate.Text, 4) & Left$(mskDate.Text, 2) & Mid$(mskDate.Text, 3, 2)

"Report".Connect = "DSN = ;UID = ;PWD = ;DSQ = "

"Report".ReportFileName = Path & "\ReportName.rpt"
"Report".ParameterFields(0) = "Date;" & sDate & ";TRUE"
'If you have multiple parameters, make sure they are listed in the same order as they are in Crystal and that you use the same name too.

' Print report to window
"Report".Destination = crptToWindow
' Show the Print button on the viewer
"Report".WindowShowPrintBtn = True
' Show the Export button on the viewer
"Report".WindowShowExportBtn = True
' Show the Refresh button on the viewer
"Report".WindowShowRefreshBtn = True
' Print the report to the window
"Report".Action = 1

Hope this helps!
 
You might also want to check out the FAQ on the Saved Data Trap ( faq766-1006 ) Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top