29. Create a Form for Reports

In this step, you will create your report form. You will add two instances of the list view to the form, along with the item view. You will configure rules for each of the list views, so that one displays items waiting for approval and the other displays items waiting for finance processing.

  1. Add a new form to the application with the following settings:
    FieldValue
    NameExpense Claim Dashboard
    DescriptionDashboard view of expense claims.
    Category(Leave default value unchanged.)
    1. From the K2 Application elements page, click New > Form. Configure the general settings as follows:
      FieldValue
      NameExpense Claim Dashboard
      DescriptionDashboard view of expense claims.
      Category(leave default value unchanged)
  2. Drag the Expense Claim Reports view onto the form and rename the view Average Instances and Duration.
    1. Select the Views tab in the left-side column, then drag the Expense Claim Reports view onto the design canvas. Rename the view
      Average Instances and Duration.
  3. Drag two instances of the Expense Claim List view onto the design canvas and rename each as follows: Expense Claims Waiting Approval, Expense Claims Waiting Processing. Change the form theme to SharePoint 2013.
    1. Drag two instances of the Expense Claim List view below the chart view, then rename each as follows:
      Expense Claims Waiting Approval
      Expense Claims Waiting Processing
    2. Next, you will change the form's look and feel by selecting a different theme. Select the form (anywhere in the white space), then change the Theme property to SharePoint 2013.
  4. Edit the form initializing rule and add two actions that call the Get List Items method for each of the list views. Change the two actions to run as a batch. You will configure the actions in the next step.
    1. Next, you will edit a rule and add actions that retrieve expense claim items from the SharePoint list.
      Navigate to the RULES screen, then edit the When the Form is Initializing rule.
    2. Add two Execute a View method actions to the rule definition pane. Configure each to call the Get List Items method, one for each of the two list views on the form. Change the two actions so that they run as a batch.

  5. Configure the Expense Claims Awaiting Approval action first. On the Input Mappings screen, enter Submitted for the Status column.
    1. Click (configure) for the Expense Claims Awaiting Approval actions.
    2. On the Input Mappings screen, enter
      Submitted
      for the Status, then click FINISH.
    3. You are filtering the SharePoint list items by the status property. In this case, you want all list items with a status of "Submitted" returned. Items that are approved or waiting for finance processing will have a different status and are not returned.

  6. Configure the Expense Claims Awaiting Processing action. On the Input Mappings screen, enter Approved for the Status column. Finish the form design.
    1. Click (configure) for the Expense Claims Awaiting Processing action.
    2. On the Input Mappings screen, enter
      Approved
      for the Status column, then click FINISH. Once again, you are filtering the list results by the status property. This time, only items that have been approved and are currently waiting for finance processing appear.
    3. Click OK to close the Rule Designer then FINISH the form design.
Review

In this step, you created the form that hosts the reporting views. Your "dashboard" displays the item view with the two chart controls and two instances of the reporting list view. You configured actions so that one list view retrieves expense claim items waiting for approval and the other list view returns items waiting for finance processing. In the next step, you will create a new page in SharePoint that displays the reporting form.

Next Step: 30. Add the Form Viewer Web Part
Expense Claim Application