GaWill
Member
[RESOLVED]Crystal Reports
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 :
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
PublicClass Form1
Dim strdate AsString
PrivateSub ConfigureCrystalReports() 'Config for Method
strdate = TextBox1.Text
Dim mySelectFormula AsString = "{Clinic.complete} <> 'yes' " _
& "AND {Clinic.Booked_date} = 'Strdate' "
Dim reportPath AsString = Application.StartupPath & "\" & "CustomersBySalesName.rpt"
MyCrystalReportViewer.SelectionFormula = mySelectFormula
MyCrystalReportViewer.ReportSource = "C:\Documents and Settings\willmg01\VB\ClinicReport\ClinicReport\clinicreport.rpt"
EndSub
PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
EndSub
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
strdate = TextBox1.Text
ConfigureCrystalReports() 'Calls the Method
EndSub
EndClass
Any ideas how i can pass the parameter into the method so i can use it in the selection formula?
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 :
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
PublicClass Form1
Dim strdate AsString
PrivateSub ConfigureCrystalReports() 'Config for Method
strdate = TextBox1.Text
Dim mySelectFormula AsString = "{Clinic.complete} <> 'yes' " _
& "AND {Clinic.Booked_date} = 'Strdate' "
Dim reportPath AsString = Application.StartupPath & "\" & "CustomersBySalesName.rpt"
MyCrystalReportViewer.SelectionFormula = mySelectFormula
MyCrystalReportViewer.ReportSource = "C:\Documents and Settings\willmg01\VB\ClinicReport\ClinicReport\clinicreport.rpt"
EndSub
PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
EndSub
PrivateSub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
strdate = TextBox1.Text
ConfigureCrystalReports() 'Calls the Method
EndSub
EndClass
Any ideas how i can pass the parameter into the method so i can use it in the selection formula?
Last edited: