Reputation: 25
I have a table name logs that holds the accomplishments log of the employees in a particular organization
ID
User_ID
Logs
StartDate
StartTime
FinishedDate
FinishedTime
I want only to print based on two user inputs. The User_ID and FinishedDate. How to achieve it using Crystal Report?
Upvotes: 0
Views: 3983
Reputation: 5878
This assumes you already have a report displaying data from that table (and you don't already have parameters in your report):
To apply these parameters from your VB application after data binding, you need to call the SetParameterValue method on the report object as follows:
report.SetParameterValue("User_Id", 1256)
report.SetParameterValue("FinishedDate", date)
Edit
You'll need to research loading data into your report in more detail. Your question was how to pass parameters to crystal from VB.net. Below is a brief run through:
' Create a report document - pointing to your .rpt file
report = new ReportClass()
report.FileName = fileName
' Assign the report object to your viewer
ReportViewer.ReportSource = report
' perform any database logon
report.SetDatabaseLogon(...credentials...)
Upvotes: 1