Creating a Report Template

You must create a report template file content so that it can be compiled into a report page in the Vocera Analytics Web console.

Vocera provides license for Crystal Reports 2016, which is included in the same email that contains the Vocera Analytics product license key.
Note: Only the Crystal Reports license key is provided. To download Crystal Reports, go to https://www.crystalreports.com/download/.
  1. Create a report template file in the following location: <Install Drive>\Path of Visualization Server folder\conf\Report Templates.

    For example: C:\VoceraAnalytics\visualizationserver\conf\Report Templates.

    This report template file content is compiled into a report page in the Vocera Analytics Web console.

  2. Define your report template file as shown below:

    The name format for the report template file must be given as: <Report Name>.rp.tpl

    For example, Outgoing Calls.rp.tpl.

    The Outgoing Calls report has parameters such as Date Range, Facilities, and Units. The code for tpl file is as follows:

    <va-report rpt-name="Outgoing Calls">
     
        <va-report-container
            rpt-file="OutgoingCalls.rpt"
            filter-params="fromTime|toTime|sites|units"/>
        <va-filter>
            <va-date-range-picker/>
             <va-dropdown name="sites" label="Facilities"
                        bind-name="Site_Clause"
                        table-name="cwfacility"
                        column-name="common_facility_id"
                        filter-data-source="cwfacilities"
                        header="All"
                        select-limit="10"
                        place-holder-text="Select Facilities"
                        multiple="true"/>
     
            <va-dropdown name="units" label="Units"
                        bind-name="Unit_Clause"
                        table-name="cwunit"
                        column-name="common_unit_id"
                        filter-data-source="cwunits"
                        filter-params="sites"
                        header="All"
                        select-limit="10"
                        place-holder-text="Select Units"
                        multiple="true"/>
     
        </va-filter>
     
    </va-report>
  3. Name the tpl file for BadgeFirmware report as BadgeFirmware.rp.tpl

    The Badge Firmware report has parameters such as Date Range, Facilities, and Device Versions.

    The code for Badge Firmware report is as follows:

    <va-report rpt-name="Badge Firmware">
    
    	<va-report-container 
    		rpt-file="BadgeFirmware.rpt" 
    		filter-params="fromTime|toTime|sites|deviceVersions"/>
    	<va-filter>
            <va-date-range-picker/>
            <va-dropdown name="sites" label="Facilities"
                        bind-name="Site_Clause"
                        table-name="cwfacility"
                        column-name="common_facility_id"
                        filter-data-source="cwfacilities"
                        header="All"
                        select-limit="100"
                        place-holder-text="Select Facilities"
                        multiple="true"/>
    					 
    		<va-dropdown name="deviceVersions" label="Device Versions"
                         bind-name="DeviceVersion_Clause"
                         table-name="fctDeviceActivity"
                         column-name="DeviceVersion"
    			 filter-data-source="deviceVersions"					         header="All"
                         select-limit="10"
                         place-holder-text="Select Device Versions"
                         multiple="true"/>                
        </va-filter>	
    </va-report>
    
    

The following table lists the custom control name and its description:

Custom Control Name Description
va-report Container of the whole report page.
va-filter Container of filters used in the report template.
va-date-range-picker Date range picker. It automatically creates the key fromTime and toTime.
va-dropdown It is a drop-down control. It has the following parameters:
  • name: Name of the drop-down to be shown as a label.
  • bind-name: Parameter name in Crystal reports to which the value should map.
  • table-name: Table name to form the where clause.
  • column-name: Column Name to form the where clause.
  • filter-data-source: Relative path of rest api. The preceding forward slash is not required.
  • header: The value to be shown in the drop-down when nothing is selected. Specify it as "All."
  • select-limit: The maximum number of elements that can be used in the drop-down.
  • multiple: Set it to true if multi selection need to be enabled.
va-report-container Container of the Crystal report frame.
  • rpt-file: Name of the rpt file.
  • filter-params: List of parameters separated by a pipe (|) that the report depends on. The parameters fromTime and toTime keys are automatically created when va-date-range-picker is included in the template.

Proceed to add your report as a menu item. For a step-by-step instruction, see Adding Your Report As A Menu Item.

For further insights, check out the related topics below: