×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

refreshing parameters

refreshing parameters

refreshing parameters

(OP)
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

RE: refreshing parameters

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!

RE: refreshing parameters

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
http://www.kenhamady.com/
tek@kenhamady.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close