29. Create a Form for Reports

In this step, you create your report form. You add two instances of the list view (you just created) to the form, along with the reporting item view. You 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 (and click CREATE):
      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 on the left side of your screen and 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, change the form's look and feel by selecting a different theme. Select the form (anywhere in the white space) and change the Theme property to SharePoint 2013.
      Set Form ThemeSet Form Theme
  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 configure the actions in the next step.
    1. Next, edit a rule and add actions that retrieve expense claim items from the Expense Claim SmartObject.
      Navigate to the RULES screen and 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. You are applying a filter that returns all records that have a "Submitted" status.
    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 SmartObject 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 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. Here, you are filtering the records that are approved and waiting for finance processing.
    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 create a quick launch link in SharePoint that opens the reporting dashboard.

Next Step: 30. Create a Quick Launch Link in SharePoint that Opens the Reporting Dashboard
Expense Claim Application