Crystal Reports

GaWill

Member
Joined
Feb 16, 2006
Messages
13
Location
South Wales
Programming Experience
Beginner
[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
End
Class


Any ideas how i can pass the parameter into the method so i can use it in the selection formula?
 
Last edited:
Have now used the parameters directly from crystal reports as suggested instead of using parameters within the code.

My program is now fully functional and working well :)
 
Back
Top