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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change the default date in parameters?

Status
Not open for further replies.

Nilsen

MIS
Dec 31, 1999
36
US
We are in the process of upgrading from CR6 to CR7, and I'm cleaning up some of the messy parameters that we were forced into with CR6.&nbsp;&nbsp;I've got two questions related to date parameters.<br><br>1)&nbsp;&nbsp;Many of our reports are run off of data through yesterdays date, thus would like the default parameter date to be yesterdays date rather than todays.&nbsp;&nbsp;Is there a way to set the default date to be different than todays date?<br><br>2)&nbsp;&nbsp;We have a couple reports that require a MM/YYYY parameter (without the DD).&nbsp;&nbsp;In CR6, we had this set up as a string parameter then converted it to a date parameter.&nbsp;&nbsp;Is there a way in CR7 to have this a date parameter where only the month and year are selected?
 
1) &quot;If you would like to base the date range on a date other than today's date, you must either change the date via the Date/Time option in the Windows Control Panel or change the report print date via the Set Print Date/Time command in the Report Menu.&quot;<br>I got the above from CR7 Help file.<br>2) You can format the date field to exclude the day.&nbsp;&nbsp;Right click the field and choose Format Field.
 
1)&nbsp;&nbsp;Changing the date/time in Windows will not work, as several dates in their applications use that date for creation dates and activity tracking.&nbsp;&nbsp;By changing the print date/time in Crystal, It does not change the date displayed by the parameter when the users run the report.&nbsp;&nbsp;It still displays todays date.<br><br>2)&nbsp;&nbsp;I can change the way the parameter field would look on the report, but not how the parameter looks when prompting the user.&nbsp;&nbsp;Looks like the only way to remove the day from the parameter is to set it up as a string and convert it to month, year via formula's.
 
1)&nbsp;&nbsp;What you could do is use a default string value (I work with MSSQL7 and SCR 7, so date formats need to be passed as strings anyway).&nbsp;&nbsp;For example, I use a&nbsp;&nbsp;default parameter of '&nbsp;&nbsp;/&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;&nbsp;', which I then substitute with a date value if the user doesn't replace it with a date value.&nbsp;&nbsp;I use the parameter mask ##/##/#### to encourage proper formatting, and a date check in the stored procedure for user entered dates.<br>What would be nice is a formula editor for default values, so that it could be a dynamic lookup table, or a calculated value, or whatever.&nbsp;&nbsp;Please tell me it's there...<br>2)&nbsp;&nbsp;I think you got the only reasonable solution for this, given the restrictions on the default values for parameters <p>Malcolm Wynden<br><a href=mailto:wynden@island.dot.net>wynden@island.dot.net</a><br><a href= > </a><br>
 
I have a similiar situation here where we need to run many reports with yesterdays date using the Crystal Enterprise scheduler. However, the end user will also be able to run reports on demand, so I don't wish to confuse them by hard coding {?startdate} - 1, then having them remember to enter the following day for reports they run.
CE tech support says there is no way to change the functionality of their scheduler because the source is not available via the SDK.
There is a 'report Plug-in for scheduling' written in CSP that interact with the APS database and allows on the fly changing of parameters, database logins and 'select formulae' but entails writing your own scheduler.

Nilsen, have you found a way around this or do I have to write my own scheduler (arrrg..).

thanks kaiso
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top