From Bright Pattern Documentation
Jump to: navigation, search
 
m
 
Line 1: Line 1:
 
<translate>= BPXML Syntax and Samples=
 
<translate>= 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.
 
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 ==
 
== Syntax ==
Line 23: Line 22:
 
** '''"string"''' - an arbitrary string value
 
** '''"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>
  
== Sample BPXML Report ==
 
<blockquote>
 
<?xml version="1.0" encoding="UTF-8"?><br />
 
<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 />
 
  team_name<br />
 
  FROM agent_performance<br />
 
  WHERE start_time > $P{start_time} AND login_id=$P{login_id}<br />
 
]]><br />
 
</queryString><br />
 
</BPcsvReport>
 
</blockquote>
 
  
  
 
== "agentlist" Usage Sample ==
 
== "agentlist" Usage Sample ==
<blockquote>
+
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?><br />
+
<BPcsvReport version="1.0" resourceBundle="com.brightpattern.reports.oob_reports">
<BPcsvReport version="1.0" resourceBundle="com.brightpattern.reports.oob_reports"><br />
+
   <parameters>
   <parameters><br />
+
     <parameter name="start_time" type="timeframe" subtype="start"/>
     <parameter name="start_time" type="timeframe" subtype="start"/><br />
+
     <parameter name="end_time" type="timeframe" subtype="end"/>
     <parameter name="end_time" type="timeframe" subtype="end"/><br />
+
     <parameter name="login_id" type="agentlist" />
     <parameter name="login_id" type="agentlist" /><br />
+
   </parameters>
   </parameters><br />
+
   <queryString>
   <queryString><br />
+
   <![CDATA[
   <![CDATA[<br />
+
   SELECT   
   SELECT  <br />
+
   start_time,
   start_time,<br />
+
   first_name,
   first_name,<br />
+
   last_name,
   last_name,<br />
+
   num_calls_in,
   num_calls_in,<br />
+
   num_calls_answered,
   num_calls_answered,<br />
+
   team_name
   team_name<br />
+
   FROM agent_performance
   FROM agent_performance<br />
+
   WHERE start_time > $P{start_time} AND login_id IN ($P{login_id})<br />]]
   WHERE start_time > $P{start_time} AND login_id IN ($P{login_id})<br />]]><br />
+
  </queryString>
  </queryString><br />
+
</BPcsvReport>
</BPcsvReport>
+
 
</blockquote>
 
  
  
  
<center>[[custom-reporting-tutorial/Overview|< Previous]]  |  [[custom-reporting-tutorial/HowtoModifyandUseBPXMLReportTemplates|Next >]]</center>
 
 
</translate>
 
</translate>

Latest revision as of 16:59, 29 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>


"agentlist" Usage Sample

<?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>


< Previous | Next >