View Categories

Report sample with parameters

< 1 min read

Let's create a report that breaks down products by category. Place the list of categories in the main report and the list of products in a subreport (on separate pages within the same report template).

Step 1: Open the Report Designer.

Step 2: connect data.

Step 3: Add ReportTitleBand if needed.

Step 4: add a data band with a list of categories.

Step 5Add a :Child band.

Step 6: Place the Sub-Report component in this band. At the same time, a new page subReport_1 is added to the report template.
 

 
Step 7: Go to a new page in your report template and place bands with product list, title and totals as desired.

information
 When you go to preview, for each category you will see the entire list of products without considering which category the product belongs to.
To display only the products belonging to a category, we need to add parameters with the category key and transfer them to the subreport.

Step 8: Return to the category list page.

Step 9: Invokes the subreport editor and displays the Parameters tab.

Step 10: Add a new parameter and specify the name and the column Categories.CategoryID as an expression.

Step 11: Return to the products page and specify a filter expression using this parameter Products.CategoryID == (int)this[“CategoryID”];

Step 12: Go to preview. A product list is displayed by category.