denver5o
asked on
Want to run report in Crystal Reports Server using current date
I am trying to run a report in Crystal Reports Server XI that would use the current date as a default parameter.
The trouble is, when I set it up in CR Management Console, I can't get the system to recognize any terms for current date (e.g., "sysdate", "today()", "date()").
Whenever I try to enter these terms in the report parameters (e.g., in the Crystal Reports Server report folder under the Process tab, selecting Parameters) or in CR InfoView, I get an error message saying "A request was cancelled. The necessary security privileges could not be verified. This indicates a problem with the security server." However, this security problem disappears if I just enter a date in the requested format: yyyy-mm-dd.
Now, I suspect the reason for this problem may be rooted in the field type. The DateThru field apparently comes to me via stored procedure as a string, instead of a date. So I'm suspecting I need to not only to determine the current date, but also match this date to the string field called DateThru.
Any ideas how I can set this up?
The trouble is, when I set it up in CR Management Console, I can't get the system to recognize any terms for current date (e.g., "sysdate", "today()", "date()").
Whenever I try to enter these terms in the report parameters (e.g., in the Crystal Reports Server report folder under the Process tab, selecting Parameters) or in CR InfoView, I get an error message saying "A request was cancelled. The necessary security privileges could not be verified. This indicates a problem with the security server." However, this security problem disappears if I just enter a date in the requested format: yyyy-mm-dd.
Now, I suspect the reason for this problem may be rooted in the field type. The DateThru field apparently comes to me via stored procedure as a string, instead of a date. So I'm suspecting I need to not only to determine the current date, but also match this date to the string field called DateThru.
Any ideas how I can set this up?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
But now what I really want to do is make it so that the Crystal Report always uses the current date... and I can't do that.
I've tried putting in terms like "now()" or "getdate()" into the parameters when Crystal Reports asks for them, but it will only accept the specific DateTime format (e.g., 2008-04-30 00:00:00). I've also tried creating a formula where UpToToday is simply CurrentDateTime, and/or setting the report parameter DateThru equal to CurrentDateTime, but no dice.
I wonder if it's easier to change things on the Crystal Reports side, or on the Stored Procedure side? I've attached the initial snippets of the Stored Procedure code as well, in case that helps.
Open in new window