on 2013 Apr 19 12:12 PM
Hi Experts,
I have a report with date parameter.When i run the report it is asking for date parameter.
Now i need to run the report with current date instead of date parameter.when i run the report It should run for current date without asking date parameter.
Please suggest an approach.
Thanks
Hi Vissu,
If it is report level parameter (parameter created in the CR Designer manually), then just delete it and add the record selection formula with a code like this:
{date_field_in_database} = currentdate
If the Parameter is one that is created by the datasource (like a stored proc with an IN prompt), then you would need to use the Subreport method to pass the current date and stop being prompted for a date value.
1) Create a blank Main Report. Create a formula with this code:
currentdate
2) Insert the original report as a subreport
3) Right-click this Subreport > Go to the Change Subreport Links > Move the formula you created above to the "Fields to link to" pane.
4) From the drop-down where it says "Subreport parameter field to use", choose the date parameter from the Subreport
If you do not see a parameter in the drop-down, it could mean that the parameter's is a datetime prompt and the formula is a date type value. So you would need to change the formula to :
currentdatetime
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vissu,
If you don't want to be prompted for a date and instead want the report to run for the currentdate, then remove the command level parameter.
In the SQL, the where clause should then be modified to use a database specific function like CURDATE().
For e.g: Select * from table where date_field = CURDATE()
-Abhilash
Hi
In record selection hard code the follwoing formula
{datefield} = CurrentDate. // currentdate is one of the function from crystal reports
-Shahnawaz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.