28. Create an Item View for Reports
In this step, you create an item view and add reporting controls. K2 provides a number of reporting controls out-of-the-box which you can find in the K2 Designer > Toolbox. The reporting controls show the number of expense claims submitted over the last 30 days and the average processing time for the claims.
- Begin by adding a new view from the K2 Application elements page. Use the table below to configure the general properties.
Field | Value |
---|
Name | Expense Claim Reports |
Description | Contains report controls for expense claims. |
Category | (leave default value unchanged) |
View Type | Item View |
Data Source | (default) |
- From the K2 Application elements page, add a new item view and configure it with the following settings:
Field | Value |
---|
Name | Expense Claim Reports |
Description | Contains report controls for expense claims. |
Category | (leave default value unchanged) |
View Type | Item View |
Data Source | (default) |
- Add a layout table with one column and two rows. Add a Workflow Duration Chart control to each row in the layout table.
- On the layout screen, click the Create Layout Table only link and configure the table with one column and two rows.
- From the Toolbox, drag a Workflow Duration Chart control into each of the table rows.
- In the Properties pane, configure the first chart control as follows:
Property | Value |
---|
Name | Chart Instances |
Text | Number of claims submitted |
Workflow Names | Use the ellipsis button to select the Expense Claim Workflow. |
Status | (All) |
Range | Last 30 days |
Group By | Weekly |
Display Value | Instance Count |
- Select the first chart on the view and configure the properties as follows: (Keep the default values for the remaining properties.)
Property | Value | Notes |
---|
Name | Chart Instances | |
Title | Number of claims submitted | |
Workflow Names | Use the ellipsis button to select the Expense Claim Workflow
| You only want to show the Expense Claim Workflow on this report. |
| |
Status | (All) | |
Range | Last 30 days | You only want to show data for the last 30 days. |
Group By | Weekly | |
Display Value | Instance Count | This display shows the number of workflow instances started. |
- Configure the second chart control as follows:
Property | Value |
---|
Name | Chart Duration |
Text | Average Duration |
Workflow Names | Use the ellipsis button to select the Expense Claim Workflow. |
Status | (All) |
Range | Last 30 days |
Group By | Weekly |
Display Value | Duration |
- Select the second chart and configure the properties as follows: (You can leave all other properties on their default values.)
Property | Value | Notes |
---|
Name | Chart Duration | |
Text | Average Duration | |
Workflow Names | Use the ellipsis button to select the Expense Claim Workflow
| You only want to show the Expense Claim Workflow on this report. |
Status | (All) | |
Range | Last 30 days | You only want to show data for the last 30 days. |
Group By | Weekly | |
Display Value | Duration | This display shows the average duration of workflows. |
- Modify the when the View executed initialize rule to call the Run Chart method as a batch for each report control.
- Navigate to the RULES screen and edit the When the View executed Initialize rule.
- Notice in the rule definition pane, K2 has already added rules for the chart controls. Each chart control is configured for the Run Chart method by default. Configure the rules to run in a batch by clicking then and selecting also for both actions. The rule should look like the image below.
- Click OK to close the rule designer and FINISH the form designer.
Review
In this step, you created an item view that contains two workflow reporting controls. The first control displays the number of workflow instances and the second control displays the average duration. K2 provides a number of out-of-the-box reporting controls you can use to create your own custom reporting dashboard. In the next step, you create a new form and add the new list and item views.