官术网_书友最值得收藏!

Adding filters to data regions

This recipe will use the parameters added in the previous recipe and influence the report. Of the two parameters added, the one with the Boolean type will be used to show or hide the chart data region, while the one with the String type will be used to restrict the data shown in the table data region.

How to do it…

Filters can be added to the data regions, as follows:

  1. Select the CustTransPie chart data region and open its properties.
  2. Click on the Visible property and open the expression editor. In the editor, enter the following expression. The expression helps to relate the visibility of the control based on the parameter:
    =IIF(Parameters!ShowPieChart.Value, True, False)
  3. Navigate to the Filters node of CustTransTable and create a new filter.
  4. On the new filter node, set the following properties:
  5. The data region displays only the data for which the expression evaluates to 1.
  6. Now that the report is finally over, select preview and activate the parameters tab. The parameters that were added are visible along with the standard parameters. Verify the parameters through the report preview.
  7. The report is now ready to be deployed. The deployed report dialog should appear as shown:
  8. The deployed report will show up as seen here in the image.

How it works…

Filters are present in the data region and are used to apply a filter on a specific data region. A filter works on the client side and operates on the flattened data. This is used in cases where the data needs to be restricted only to a certain data region and not the entire dataset. As you can see, the chart data is summarizing the entire data but the table data region shows the data only for the selected customer group.

Filters must be used cautiously and must not be considered as an alternative for a query range. The reason being that the system fetches the whole data from the datasource, after which it applies the filter:

主站蜘蛛池模板: 怀安县| 芮城县| 丹棱县| 新兴县| 南川市| 永川市| 兰溪市| 松潘县| 安吉县| 登封市| 茌平县| 老河口市| 新竹县| 中阳县| 和龙市| 南昌市| 茶陵县| 阿拉善左旗| 尼木县| 资源县| 土默特左旗| 手游| 宁晋县| 宝鸡市| 西乡县| 年辖:市辖区| 庆城县| 东港市| 瑞丽市| 永登县| 康平县| 安吉县| 宿松县| 济阳县| 徐水县| 广灵县| 孟津县| 呼图壁县| 承德市| 谷城县| 乌鲁木齐县|