Mar 6, 2012

Report Parameters (Report Builder 3.0 and SSRS)

Report parameters enable you to control report data, connect related reports together, and vary report presentation. To design a report that uses parameters effectively, you must understand how parameters and dataset queries are related, how to include parameters in expressions, and how to manage parameters independently from a report definition on the report server or SharePoint site.
You can create report parameters in the following ways:
  • Create or add a dataset, embedded or shared, that has a query that contains query variables.
  • Create a parameter manually from the Report Data pane.
  • Add a report part that contains references to a parameter or to a shared dataset that contains variables.
After you publish a report, you can manage parameters independently from the report definition. You can even create multiple sets of parameters for the same report.
The report viewer toolbar displays each parameter so that a user can interactively specify values. The following illustration shows the parameter area for a report that has parameters @StartDate, @EndDate, @Subcategory, and @ShowAllRows.
Parameters on report viewer toolbar
  1. Parameters pane   The report viewer toolbar displays a prompt and default value for each parameter. Parameter layout on the toolbar is formatted automatically. The order is determined by the order that parameters appear in the Report Data pane.
  2. @StartDate and @EndDate parameters   The parameter @StartDate is data type DateTime. The prompt Start Date appears next to the text box. To modify the date, type a new date in the text box or use the calendar control.
    The parameter @EndDate appears next to @StartDate.
  3. @Subcategory parameter   The parameter @Subcategory is data type Text. Because @Subcategory has an available values list, valid values appear in a drop-down list. You must choose values from this list. Because @Subcategory is multivalued, a Select All option appears that enables you to clear all and select all values in the list.
  4. @ShowAllRows parameter   The parameter @ShowAllRows is data type Boolean. Use the radio buttons to specify True or False.
  5. Show or Hide Parameter Area handle   On the report viewer toolbar, click this arrow to show or hide the parameters pane.
  6. Parameters button   In Report Builder preview, on the Ribbon, click the Parameters button to show or hide the parameters pane.
  7. View Report button   On the report viewer toolbar, click View Report to run the report after you enter parameter values. If all parameters have default values, the report runs automatically on first view.

No comments:

Post a Comment


Thanks for your visit to this blog.
We would be happy with your Queries/Suggestions.