Hi ive got crystal reports loading my data successfully from my database, what i wan to do now is to only select certain parts of that data by using the date entered into a text box as part of the selection forumla for the report.
Here is my code :
VB Code:
Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Public Class Form1 Dim strdate As String Private Sub ConfigureCrystalReports() 'Config for Method strdate = TextBox1.Text Dim mySelectFormula As String = "{Clinic.complete} <> 'yes' " _ & "AND {Clinic.Booked_date} = 'Strdate' " MyCrystalReportViewer.SelectionFormula = mySelectFormula MyCrystalReportViewer.ReportSource = "C:\Documents and Settings\willmg01\VB\ClinicReport\ClinicReport\clinicreport.rpt" End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click strdate = TextBox1.Text ConfigureCrystalReports() 'Calls the Method End Sub End Class
Any ideas how i can pass the parameter into the method so i can use it in the selection formula?


Reply With Quote