crystal_reports thread: Re: Passing a parameter "date" from VB to Crystal Reports
Try the following code :
Private Sub Command1_Click()
CrystalReport1.ParameterFields(0) = "begin_date;Date(" &
Format$(Text1.text,"YYYY,MM,DD") & ");true;"
CrystalReport1.ParameterFields(1) = "end_date;Date(" &
Format$(Text2.text,"YYYY,MM,DD") & ");true;"
CrystalReport1.WindowState = crptMaximized
----- Original Message -----
From: "Maria Georgieva" <mgeorgieva@t...>
To: "crystal_reports" <crystal_reports@p...>
Sent: Friday, January 31, 2003 4:21 PM
Subject: [crystal_reports] Passing a parameter "date" from VB to Crystal
> I have a problem with passing "date" parameters from VB to CReports.
> I designed a report in Crystal reports v8.0 and I want to call it from VB
> I have 2 parameters which determined what info is displayed on the report
> and I want to get these parameters from VB and pass them to CReports.
> I use informix db via ODBC.
> I made an attempt and understood that
> the code bellow is working if the parameter type is number or string.
> But if it's a "date" - it doesn't work.
> My parameters in CReports are :
> begin_date, date
> end_date, date
> My code in VB is:
> Private Sub Command1_Click()
> CrystalReport1.ParameterFields(0) = "begin_date;" & Text1.text
> & ";true;"
> CrystalReport1.ParameterFields(1) = "end_date;" & Text2.text &
> CrystalReport1.WindowState = crptMaximized
> End Sub
> In CReports everything is ok when I put the parameters values.
> What to do ?
> I hope you help me.
> Thanks, Maria