x
Wyn 4.0 launches with more extensibility, enhanced embedded business intelligence, and an improved end-user experience. Learn More Wyn 4.0 launches, enhanced embedded business intelligence, improved end-user experience. Learn More Wyn 4.0 launches

Create Parameterized Report

Wyn Enterprise allows you to use parameters to filter or add the data to display in reports at run time. You can either prompt users for parameters so that they control the output, or supply the parameters behind the scenes.

What You Will Learn

This tutorial guides you through the steps to create a parameterized report in Wyn Enterprise Report Designer.

Note: This tutorial uses sample SalesByRegion data set.

After you complete this tutorial, you will have a report that looks similar to the following.

(Parameter1 = Canada West and Parameter2 = 1005)

Create Report Layout

Let us use Table data region to the display data. Drag and drop Table data region onto the design area of the report.

Bind Data to Table Data Region

  1. To view fields in the added data set, click the dropdown next to the SalesByRegion data set.
  2. To fill the table with data, drag and drop the fields onto the columns of the detail row.
  3. In our case, drag and drop the SaleDate field on the first column, Quantity field on the second column, and Profit field on the third column. The Header row above the details row is automatically filled with labels.

  4. To remove the table footer, right-click the bottom row and select Remove Footer.

Add Parameter to the Report

Let us add two parameters that would act as filters for data retrieved from the data source, one would be passed as filter for the region, and the other to filter the data according to store.

To add a report parameter that filters the data according to the region,

  1. From the top right corner of Report Designer, click the Data icon .
  2. Click Add next to Parameters. A parameter named Parameter1 is added.
  3. Click Parameter1 to edit parameter properties.
  4. Set Data Type property to String.
    The following image shows how these properties are set:

  5. Go to From query tab and set the following properties.

Property Value
Data Set Name SalesByRegion
Value Field Region
Label Field Region

The following image shows how these properties are set:
         

To add parameter that filters the data according to the store id,

  1. From the top right corner of Report Designer, click the Data icon .
  2. Click Add next to Parameters. A parameter named Parameter2 is added.
  3. Click Parameter2 to edit parameter properties.
  4. Set Data Type property to Integer.

The following image shows how these properties are set:
         

  1. Go to From query tab and set the following properties.
Property Value
Data Set Name SalesByRegion
Value Field StoreID
Label Field StoreID

The following image shows how these properties are set:
         

The Parameters property now shows the two parameters as follows.
         

Manage Data in the Report

In order to control the amount of data rendered in the report, we can add filters to the Table data region. In our report, we will be adding two filters as follows.

To add filter that renders data according to the user input in the parameter (Parameter1),
         

  1. Select the table and go to Properties pane.
  2. In the Filters property, click Show Items, and then select Add Item.
  3. Click to display the filter properties.
  4. Click the radio button next to Filter Expression to display the fields and select Region.
  5. Click the drop down next to Operator and select 'Equal'.
  6. Click the radio button next to Value and enter the expression =Parameters!Parameter1.Value.
    To add filter that limits the data according to store id parameter (Parameter2),

  7. In the Filters property, click Show Items, and then select Add Item.

  8. Click to display the filter properties.
  9. Click the radio button next to Filter Expression to display the fields and select StoreID.
  10. Click the drop down next to Operator and select 'Equal'.
  11. Click the radio button next to Value and enter the expression =Parameters!Parameter2.Value.
    The Filters property now shows the two filters as follows.

Customize the Appearance of Parameterized Report

Note: You may need to resize and reposition the controls on the report to accommodate data, and for a cleaner look.

  1. To apply background color to the table, select the Table data region.
  2. Set the BACKGROUND - Color property to Light Yellow from the colors available on Web tab of the color pallet.
  3. To customize the Header row of the table, set the following properties for each text box in the row.
Property Value
TEXT - Font Weight Bold
TEXT - Text Align Center
  1. To customize the Details row of the table, set the TEXT - Text Align property for each text box to Center.
  2. To apply borders, select each cell of the table and set its BORDER - Style property to Solid.

Preview and Save Report

  1. Click Preview to view your report in the final output. You will be prompted to enter two parameters - select the region name and the store id for which you want to view the report, and again click Preview.

Note: The values in the Parameter list appear as sorted only if the data values are sorted in data set.

  1. Exit the preview mode by clicking Back on the left side of the designer.
  2. Click Save to open the Save dialog box. Enter the report name as 'Detail Report' and click Save Report.