28. Create an Item View for Reports

In this step, you will create an item view, then add reporting controls to the view. K2 provides a number of reporting controls out-of-the-box which you can find in the designer toolbox. The reporting controls you will add 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(blank)
    1. From the K2 Application elements page, add a new item view to your application 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(blank)
  2. Add a layout table with one column and two rows, then drop two Workflow Duration Chart controls into each row of the layout table.
    1. On the layout screen, click the Create Layout Table only link and add a layout table with one column and two rows.
    2. From the Toolbox, drag a Workflow Duration Chart control into each of the rows of the table.
      Workflow Duration Chart Controls
  3. 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 will show the number of instances of the workflow that were 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 will show 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 of the view 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 the then word 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 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 will create a new form, then add both the list and item views.

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