Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Change Parameter Type? Post Reply Post New Topic
Author Message
Speedemon0202
Newbie
Newbie
Avatar

Joined: 26 Sep 2009
Location: United States
Online Status: Offline
Posts: 4
Quote Speedemon0202 Replybullet Topic: Change Parameter Type?
     Posted: 26 Sep 2009 at 10:03am
Hello!

I hate to sound like a n00b, but I have a problem to which I have found no solution.

My report has tables, and one stored procedure (SP) as data sources.

Being that I have an SP as a data source, Crystal has automatically generated params for the report, being @start_date and @end_date respectively in datetime format.

Now that's all fine and dandy, as those are the only parameters required for this report, however, this report will be used in an .ASP page which will pass the parameter values from the web browser to this report, and the dates need to be formatted as string values.

My question is this, how do I change the parameter type from datetime to string for the aforementioned parameters generated by Crystal?

If this is not possible, please let me know and we will have to get the input data type modified in the SP on the SQL server.

Thanks!
Mike-
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 26 Sep 2009 at 2:50pm

It's not possible.  Crystal will expect the same data type as the stored procedure requires. 

-Dell
IP IP Logged
Speedemon0202
Newbie
Newbie
Avatar

Joined: 26 Sep 2009
Location: United States
Online Status: Offline
Posts: 4
Quote Speedemon0202 Replybullet Posted: 27 Sep 2009 at 10:08am
Thank you for your response!  I am aware that the parameter type must be synchronous with the parameter types on the server, but shouldn't it be possible to use a string inside crystal, and convert it to datetime via cDate? 

That's what I've been doing in my other reports, as the date fields on the tables I'm using is a datetime, however I cannot find those parameters in the report objects section anywhere.

This is my first time using a sproc as a data source, so up until now I've been able to simply convert all my parameters with cDate in the record selection portion via code.

Once again, if it's not possible, I'll make do, but I thought I should ask.

Thank you!


Edited by Speedemon0202 - 27 Sep 2009 at 10:12am
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 27 Sep 2009 at 11:39am
Try using the string Date(yyyy, mm, dd) using the year, month, and day values from your date as the string you pass for the parameter.  I don't know if this will work, but I remember having to enter date parameters like that in earlier versions of Crystal.
 
-Dell
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum