Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

another parameter problem

Status
Not open for further replies.

schu

MIS
Jun 21, 2001
188
HK
I am using VB6 and CR8.5 (CR 8 ocx)

I have a stored proc on SQL 2000 which runs the results for and aging report. It required a datetime value. After reading up on the posts, I changed the datetime to string and used a convert function in the stored proc to change it back to datetime.

My Problem is it still does not work.
I have other programs passing strings as parameters and they all work. The difference is that the aging used a store proc with parameters (the other reports are just cystal parameters).

My Code

CrystalReport1.ReportFileName = "c:\VBDev\Aging.rpt"
Rem CrystalReport1.ParameterFields(0) = "CutoffDateS;" + Format(Calendar1.Value, "yyyy/mm/dd") + " 23:59:59;false"
Rem CrystalReport1.ParameterFields(0) = "CutoffDateS;" + CStr(Calendar1.Value) + ";false"
Rem CrystalReport1.ParameterFields(0) = "CutoffDateS;" + Text1.Text + ";true"
CrystalReport1.PrintReport


As you can see I tried using a text box and it still does not work.

All it does in nothing (the report does not pop up), I tried setting the true and false, but even with false the parameter screen does not pop up.

I think it is something to do with the parameter being a stored proc parameter.

However, if I do not set the parameterfields statement, the report opens, but requires the user to type in the parameter.

Any help appreciated
 
If it is ok to pass the parameter without converting the Date format, you may try this!

Rem CrystalReport1.ParameterFields(0) = "CutoffDateS;Date(" & Calendar.Year & "," & _
Calendar.Month & "," & _
Calendar.Day & ");True"
 
Thanks EmsnSekhar

I found the problem,
seems i should have used CrystalReport1.StoredProcParam(0)=....

Damn the documentation

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top