Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Parameters Post Reply Post New Topic
Author Message
Dehalo212
Newbie
Newbie


Joined: 23 Dec 2008
Online Status: Offline
Posts: 3
Quote Dehalo212 Replybullet Topic: Parameters
     Posted: 23 Dec 2008 at 6:04am
I would like to build a selection of reports with parameters.  I am new to Crystal Reports.  What are the pros and cons of working with parameters?  Any help would be appreciated.
 
Thanks.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Dec 2008 at 9:38am

This is a general question so I can only give you an abstract response.

Generally you want to use parameter fields when you want to dynamically define the way the data is organized or what data is selected each time you run the report. Otherwise using the select expert is fine. An example: You always want the last 30 days of sales from the day the report is run. Use the select expert without any parameters. You want a to choose a 30 day range of sales, use parameters that are passed into the select expert. Parameter use really depends on that you want to accomplish with the report.
 
Be aware that part of the question here is also how you are deploying the reports (say with crystal viewer). Parameters do not allways display the same way depending on this so they could be useful or confusing. Test it at the deployment side as well as when you are building the report.
A few examples of using parameters:
1) Parameter of a date range for the data allows your user running the report to defing their own range.
2) Parameter of a "Vendor" can let the end user select a specific vendor(s) they want to view instead of all of the vendors in the DB.
3) conditional grouping - you can set a report to allow the user to invert how the data is grouped. For example parameter option 1 may group by Vendor then Sales person where as Option 2 may group by Sales person then Vendor.
 
Basically you are setting up a report that the end user has much more control over what is returned when you use parameter fields.
 
You can often do similar things by using the select expert without passing Parameters but this means you are pre-defing what and how the report will show and not giving the end user the option.
Examples of just using a select statement without a parameter field:
1) Select a date range of sales for the last 3 months only.
2) Select all the Vendors from A-M or only Vendor #1.
3) Group by Vendor and worker only or group by Worker and Vendor only.
 
There is more to it than this but it may help to get you started.
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 24 Dec 2008 at 6:17am
My two cents...
 
a report without parameters is very rare.  only if you wanted to see the exact same thing...say yesterday's sales....but what if you were on vacation and wanted to see the sales from the days you were gone?  this is where the parameter comes in.  parameters give the report its power, you wouldn't want to use a program that didn't allow any input, why would you want a report that allows no variation. 
 
How you get the parameters is another story.  My company hates the crystal report parameter screen, so we have developed our own parameter input screens that then generate a dataset that we pass to the report.  Another method is to use .Net and set the parameters for a report via code and then have the report gather the data.
 
I can't think of any cons to parameters, as I view them as vital to reporting.
 
 
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum