Is this really the version you are looking for? Kentico Xperience 8 Documentation is no longer updated. Use the switcher in the header to choose your product version.
This example demonstrates how to create a report that displays a table, graph and value, and uses a reporting parameter:
In the Reporting application, click New report.
Type Pages by page template as the Report display name.
Click Save.
Type Pages by page template into the Layout text area.
Select the text and use the editor to set the Format to Heading 1.
Click Save.
Display name: Pages by Page Template
Query:
SELECT PageTemplateDisplayName AS [Template Name], DocumentNamePath AS [Document]
FROM View_CMS_Tree_Joined
LEFT JOIN CMS_PageTemplate
ON CMS_PageTemplate.PageTemplateID = View_CMS_Tree_Joined.DocumentPageTemplateID
WHERE PageTemplateDisplayName IS NOT NULL AND PageTemplateIsReusable = 1
ORDER BY PageTemplateDisplayNameIs stored procedure: no
SkinID: leave empty
Enable paging: yes (checked)
Page size: 10
Page mode: Page numbers
Switch to the View tab to see the report table.
Display name: Favorite Page Templates
Query:
SELECT TOP 5 PageTemplateDisplayName AS [Template Name], COUNT(PageTemplateDisplayName) AS [Usage]
FROM View_CMS_Tree_Joined
LEFT JOIN CMS_PageTemplate
ON CMS_PageTemplate.PageTemplateID = View_CMS_Tree_Joined.DocumentPageTemplateID
WHERE PageTemplateDisplayName IS NOT NULL AND PageTemplateIsReusable = 1
GROUP BY PageTemplateDisplayName
ORDER BY COUNT(PageTemplateDisplayName) DESCGraph type: Pie chart
Drawing style: Pie
Title: Favorite page templates
Series -> Display item value: Disabled (not checked)
If you now switch to the View tab, you can see the report graph.
Display name: Number of pages with page template
Query:
SELECT COUNT(DocumentID)
FROM View_CMS_Tree_Joined
WHERE DocumentPageTemplateID IS NOT NULLIs stored procedure: no
Formatting string: Pages with template: {0}
If you switch to the View tab, you can see the text of the value.
Now you need to add the parameter to your queries. For the purposes of this example, modify only the table query.
Switch to the General tab.
Select Pages by page template in the Table list.
Click ... next to the New button and select Edit.
Modify the table SQL query like this:
SELECT PageTemplateDisplayName AS [Template Name], DocumentNamePath AS [Document]
FROM View_CMS_Tree_Joined
LEFT JOIN CMS_PageTemplate
ON CMS_PageTemplate.PageTemplateID = View_CMS_Tree_Joined.DocumentPageTemplateID
WHERE PageTemplateDisplayName IS NOT NULL AND DocumentCreatedByUserID = @UserID
ORDER BY PageTemplateDisplayNameThis adds the parameter to the WHERE condition of the query. All parameters that you define can be used in the query using the @<ParameterFieldName> expression.
Click Save & Close.
Now switch to the View tab. You can see that the report has a filter:
The table now only displays template names of documents that were created by the user specified in the filter.