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.

  1. Begin by adding a new view from the K2 Application elements page. Use the table below to configure the general properties.
    FieldValue
    NameExpense Claim Reports
    DescriptionContains report controls for expense claims.
    Category(leave default value unchanged)
    View TypeItem View
    Data Source(default)
    1. From the K2 Application elements page, add a new item view and configure it with the following settings:
      FieldValue
      NameExpense Claim Reports
      DescriptionContains report controls for expense claims.
      Category(leave default value unchanged)
      View Type Item View
      Data Source(default)
  2. Add a layout table with one column and two rows. Add a Workflow Duration Chart control to each row in the layout table.
    1. On the layout screen, click the Create Layout Table only link and configure the table with one column and two rows.
    2. From the Toolbox, drag a Workflow Duration Chart control into each of the table rows.
      Workflow Duration Chart Controls
  3. In the Properties pane, configure the first chart control as follows:
    PropertyValue
    NameChart Instances
    TextNumber of claims submitted
    Workflow NamesUse the ellipsis button to select the Expense Claim Workflow.
    Status(All)
    RangeLast 30 days
    Group ByWeekly
    Display ValueInstance Count
    1. Select the first chart on the view and configure the properties as follows: (Keep the default values for the remaining properties.)
      PropertyValueNotes
      NameChart Instances 
      TitleNumber of claims submitted 
      Workflow NamesUse the ellipsis button to select the Expense Claim Workflow
      You only want to show the Expense Claim Workflow on this report.
       
      Status(All) 
      RangeLast 30 daysYou only want to show data for the last 30 days.
      Group ByWeekly 
      Display ValueInstance CountThis display shows the number of workflow instances started.
      Reporting Control
  4. Configure the second chart control as follows:
    PropertyValue
    NameChart Duration
    TextAverage Duration
    Workflow NamesUse the ellipsis button to select the Expense Claim Workflow.
    Status(All)
    RangeLast 30 days
    Group ByWeekly
    Display ValueDuration
    1. Select the second chart and configure the properties as follows: (You can leave all other properties on their default values.)
      PropertyValueNotes
      NameChart Duration 
      TextAverage Duration 
      Workflow NamesUse the ellipsis button to select the Expense Claim Workflow You only want to show the Expense Claim Workflow on this report.
      Status(All) 
      RangeLast 30 daysYou only want to show data for the last 30 days.
      Group ByWeekly 
      Display ValueDurationThis display shows the average duration of workflows.
  5. Modify the when the View executed initialize rule to call the Run Chart method as a batch for each report control.
    1. Navigate to the RULES screen and edit the When the View executed Initialize rule.
    2. 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.
    3. 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.

Next Step: 29. Create a Form for Reports
Expense Claim Application