I want to create a report which allows the user to select either the current year or previous year, so the default parameters are year(currentdate) and year(currentdate)-1. But I can't do this - or can I?
The default values would be the literal values "Current Year" and "Previous Year". Then conditionally set your record selection formulas bases on these values. For example:
if {?Parameter}="CurrentYear" then {InvoiceDate} in YeartoDate else {InvoiceDate} in dateadd("y",-1,minimum(YearToDate)) to date(Year(CurrentDate)-1,12,31)
Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
That's what I'm doing at the moment - but I want to present the user with the choices 2003 and 2002, or whatever the current and previous year happen to be when the report is run.
Unfortunately, you have to use external code to dynamically update a parameters value, or a third party viewer.
As dgillz meantioned, change the prompt to literally state "Current Year and Previous Year, and then let the record selection formula (report->Edit selection formula->record) determine which years they are using a formula akin to his.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.