From Bright Pattern Documentation
Jump to: navigation, search
 
Line 50: Line 50:
  
  
== "agentlist" Usage Sample ==
+
== Example BPXML Reports ==
 +
The following are examples of various types of BPXML reports. Values that differ from the Sample BPXML Report given above are shown in <font color="ff33cc">pink</font color>.
 +
 
 +
=== "agentlist" Usage Sample ===
 +
In this sample, we are using parameter ''agentlist'' to add agent data to the Agent Performance report.
 +
 
 
<blockquote>
 
<blockquote>
 
<?xml version="1.0" encoding="UTF-8"?><br />
 
<?xml version="1.0" encoding="UTF-8"?><br />
Line 57: Line 62:
 
     <parameter name="start_time" type="timeframe" subtype="start"/><br />
 
     <parameter name="start_time" type="timeframe" subtype="start"/><br />
 
     <parameter name="end_time" type="timeframe" subtype="end"/><br />
 
     <parameter name="end_time" type="timeframe" subtype="end"/><br />
     <parameter name="login_id" type="agentlist" /><br />
+
     <parameter name="login_id" type="<font color="ff33cc">agentlist</font color>" /><br />
 
   </parameters><br />
 
   </parameters><br />
 
   <queryString><br />
 
   <queryString><br />
Line 72: Line 77:
 
  </queryString><br />
 
  </queryString><br />
 
</BPcsvReport>
 
</BPcsvReport>
 +
</blockquote>
 +
 +
 +
=== "call_detail" Usage Sample ===
 +
In this sample, we are using metrics  ''hold_time'', ''held'', and ''max_hold'' to add hold time data to the Call Detail report.
 +
 +
<blockquote>
 +
<?xml version="1.0" encoding="UTF-8"?>
 +
<BPcsvReport version="1.0" resourceBundle="com.brightpattern.reports.oob_reports"><br />
 +
<parameters><br />
 +
<parameter name="start_time" type="timeframe" subtype="start"/><br />
 +
<parameter name="end_time" type="timeframe" subtype="end"/><br />
 +
<parameter name="login_id" type="agent" /><br />
 +
</parameters><br />
 +
<queryString><br />
 +
<![CDATA[<br />
 +
SELECT <br />
 +
start_time,<br />
 +
first_name,<br />
 +
last_name,<br />
 +
num_calls_in,<br />
 +
num_calls_answered,<br />
 +
<font color="ff33cc">hold_time,</font color><br />
 +
<font color="ff33cc">held,</font color><br />
 +
<font color="ff33cc">max_hold,</font color><br />
 +
team_name<br />
 +
FROM <font color="ff33cc">call_detail</font color><br />
 +
WHERE start_time > $P{start_time} AND login_id=$P{login_id}
 +
]]><br />
 +
</queryString><br />
 +
</BPcsvReport> 
 
</blockquote>
 
</blockquote>
  
  
  
<center>[[custom-reporting-tutorial/Overview|< Previous]]  |  [[custom-reporting-tutorial/HowtoModifyandUseBPXMLReportTemplates|Next >]]</center>
 
 
</translate>
 
</translate>

Revision as of 20:12, 17 August 2018

• 3.16 • 3.17 • 3.18

BPXML Syntax and Samples

You can create a custom BPXML report template and use it to export CSV data. This section explains the syntax and structure of BPXML report templates.


Syntax

The top level "BPcsvReport" element contains optional "parameters" and "queryString" sub-elements.

"queryString" is a common SQL statement, and it can contain some parameters.

Parameter Types

The following is the full set of supported parameters:

  • "agent" – agent selector
  • "agentlist" – agent multiple selector
  • "end_time"
  • "service" – service selector
  • "servicelist" – service multiple selector
  • "start_time"
  • "team” – team selector
  • "teamlist" – team multiple selector
  • "timeframe" subtypes:
    • "start"
    • "end" (only one pair per report) – start and end dates selector
    • "string" - an arbitrary string value


Sample BPXML Report

<?xml version="1.0" encoding="UTF-8"?>
<BPcsvReport version="1.0" resourceBundle="com.brightpattern.reports.oob_reports">
<parameters>
<parameter name="start_time" type="timeframe" subtype="start"/>
<parameter name="end_time" type="timeframe" subtype="end"/>
<parameter name="login_id" type="agent" />
</parameters>
<queryString>
<![CDATA[
SELECT
start_time,
first_name,
last_name,
num_calls_in,
num_calls_answered,
team_name
FROM agent_performance
WHERE start_time > $P{start_time} AND login_id=$P{login_id}
]]>
</queryString>
</BPcsvReport>


Example BPXML Reports

The following are examples of various types of BPXML reports. Values that differ from the Sample BPXML Report given above are shown in pink.

"agentlist" Usage Sample

In this sample, we are using parameter agentlist to add agent data to the Agent Performance report.

<?xml version="1.0" encoding="UTF-8"?>
<BPcsvReport version="1.0" resourceBundle="com.brightpattern.reports.oob_reports">
<parameters>
<parameter name="start_time" type="timeframe" subtype="start"/>
<parameter name="end_time" type="timeframe" subtype="end"/>
<parameter name="login_id" type="agentlist" />
</parameters>
<queryString>
<![CDATA[
SELECT
start_time,
first_name,
last_name,
num_calls_in,
num_calls_answered,
team_name
FROM agent_performance
WHERE start_time > $P{start_time} AND login_id IN ($P{login_id})
]]>
</queryString>
</BPcsvReport>


"call_detail" Usage Sample

In this sample, we are using metrics hold_time, held, and max_hold to add hold time data to the Call Detail report.

<?xml version="1.0" encoding="UTF-8"?> <BPcsvReport version="1.0" resourceBundle="com.brightpattern.reports.oob_reports">
<parameters>
<parameter name="start_time" type="timeframe" subtype="start"/>
<parameter name="end_time" type="timeframe" subtype="end"/>
<parameter name="login_id" type="agent" />
</parameters>
<queryString>
<![CDATA[
SELECT
start_time,
first_name,
last_name,
num_calls_in,
num_calls_answered,
hold_time,
held,
max_hold,
team_name
FROM call_detail
WHERE start_time > $P{start_time} AND login_id=$P{login_id} ]]>
</queryString>
</BPcsvReport>


< Previous | Next >