on 10-15-2008 3:49 PM
The date prompt is an input parameter of the stored procedure which the Crystal report accesses through Java Data Source.
Our requirement is to display the Current Date as the default in the date prompt whenever the report is run.
Crystal only allows us to give a proper date in the Default Value (under Value Options) but does not let us set the default dynamically to the current date.
Please let me know if there is any work around to pass the current Date (Sysdate) dynamically to date prompt parameter
Thanks and Regards
Purna
There is one more workaround by inserting present report as subreport and create a formula like
@date
currentdate
link this formula with the command level paramter in the subreport by using change subreport links.
Regards,
Raghavendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for Details, But Our Situation is as follows
We have a Reporting Period prompt which is static, single select and has four values Month-to-Date, Week-to-Date, Single Date and Date Range. And below it there are two prompts From Date and To Date. When the user selects Month-to-Date or Week-to-Date, From Date and To Date prompts are not considered by the query and the report runs only for the past month/week. If the user selects Single Date then only From Date prompt is considered. When the user selects Date Range both From Date prompt and To Date prompt are considered.
The From Date and To Date prompts have to be defaulted to the current date, so that when Reporting Period is Month-to-Date or Week-to-Date the user does not have to change the From Date and To Date prompt values, but if it is Single Date/Date Range then the user can change the prompt values and provide his own dates.
Since the From Date and To Date prompts are part of the procedure they cannot be made dynamic to select sysdate from DB. We cannot default it to any date like '1/1/1900' as the user will have to change this date and move the calendar from 1900 to 2008. Also, the current date cannot be passed to the date prompt from the main report, as when this is done, the report doesn't prompt for the date anymore and runs the report automatically for current date.
We want the actual current date to be displayed in the date prompt and the ability to change it as and when required.
Thanks and Regards
Purna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Purna,
To set the default date for a date parameter please follow the below steps.
1) Set the default value in the date or datetime parameters to a date that will never appear in the data (for example, 1900-01-01).
2) Enter in the Record Selection Formula field a formula similar to the following:
DateVar DateParamValue;
If {?DateParam} = Date(1900,1,1) Then
DateParamValue := CurrentDate
Else
DateParamValue := {?DateParam};
{Table.DateField} = DateParamValue;
The date parameters will now default to the current date.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.