TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Thomas Ochieng
NA
5
10.9k
Microsoft Report Viewer 2008
Sep 6 2011 6:21 AM
How do I Filter a ReportViewer through a Form?
For example, I would like to choose a Date from a Form and then use this Date to filter the Report Viewer in VB.NET 2008.
Public Class frmPatientsDetailsMasterReport
Dim sql As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub btnViewReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnViewReport.Click
sql = "SELECT * FROM tblPatientEntry WHERE RegistrationDate BETWEEN '" & DateTimePicker1.Text & "' AND RegistrationDate '" & DateTimePicker2.Text & "'"
'TODO: This line of code loads data into the 'HospitalManagementSystemDataSet.tblPatientEntry' table. You can move, or remove it, as needed.
Me.tblPatientEntryTableAdapter.Fill(Me.HospitalManagementSystemDataSet.tblPatientEntry)
Me.ReportViewer1.RefreshReport()
End Sub
End Class
Reply
Answers (
2
)
Twitter is over capacity
Test