INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Dynamic Parameters in Crystal Reports 2011

Dynamic Parameters in Crystal Reports 2011

(OP)
I'm not sure if I described my subject correctly but here is what I'm trying to do. I am using Crystal Reports 2011 and I want to create a dynamic report where the user is prompted to enter a parameter that will be used for record selection. I would like to give options for the parameter to select either monthtodate, lastfullmonth, or a date range in a drop down list. If date range is selected the user is prompted to enter a starting and ending date. If the user selects monthtodate or lastfullmonth they aren't prompted for a starting and ending date.

Nothing I've tried so far works completely. Does anyone have any ideas or suggestions? Ultimately I'll be saving the report and viewing it in Crystal Corral which supports parameters.

Thanks in advance,

Steve

RE: Dynamic Parameters in Crystal Reports 2011


You won't be able to hide/show prompts based on the value of a previous prompt, but you can at least take advantage of optional parameters. Here's one way that is close to what you want.

Create static parameter 'Date Range', define as string, and hardcode these values into it:
Month To Date
Last Full Month
Custom Date Range

Disallow custom values and make Month to Date the default (or Last Full Month, whichever your users will select most).

Create another parameter 'Custom Date Range', define as date, and as range. Make this one optional.

Now when the user refreshes, they will see both prompts but if they leave prompt 1 as Month to Date, or change it to Last Full Month, then they don't have to enter anything in the date range fields. If they select Custom Date Range they will need to pick dates from the calendar controls, but they will not be required to do so.

You would probably want to be pretty explicit with the prompt descriptions so the user knows what to do the first time they use the report.




RE: Dynamic Parameters in Crystal Reports 2011

MonthToDate and LastFullMonth are actually commands, which Crystal Reports will interpret while date range is a set of 2 dates. You cannot combine different parameter types. However, both MonthToDate and LastFullMonth can be presented as dates and this is what I would do. If you use a viewer which supports default values you can try to manage this by setting the default values for the start and end date. This will allow you to handle also other scenarios without to change the report (YearToDate, PreviousYear, PreviousQuarter, Last Used Dates etc.). To give you an idea what I am talkng about check this video ( you can go directly to 1min 42sec, the end of this functionality is arround 2:46 ): http://www.r-tag.com/Pages/Preview_ParameterTempla...

www.R-Tag.com Viewer, scheduler and report manager for Crystal reports and SSRS.
Send your report everywhere.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close