Reports_Execute

Required Inputs

  • ReportID As Integer – the ID from Rev.io's My Reports or Shared Reports sections that you intend to run.
  • Format As String – Acceptable values are CSV or XML.

Optional/Conditional Input

  • ClearCache As Boolean – when specified as true, Rev.io will ignore any cached versions of this report to ensure the information is as up-to-date as possible. Reports are cached for up to 30 minutes, and it is recommended to use the cache by default.
  • Compression As String – Acceptable values are NONE or GZIP or ZIP. Compression can only be specified with Format = "CSV".
  • Filters – List of report filters
    • Filter – A single filter
      • ID As Integer – The ID of the filter. Optional if column is specified.
      • Column As String – The column (for regular reports) or parameter name (for SQL reports) of the filter. Optional if ID is specified, however if both are specified then the value specified must match the actual value associated with the ID specified.
      • Value As String – The value of the column.
      • Type As String – Prohibited for this API function.
      • Operand As String – Prohibited for this API function.
      • Operator As String – Prohibited for this API function.
      • Editable As Boolean – Prohibited for this API function.

📘

Note:

Any optional filters of the report that are omitted will use the last run value of the report (or default if never run).

Output

  • XML – exists if the XML Format type was specified.
    • Columns – Column repeats for each column in the report
      • Column As String – Name of column.
    • Rows – Repeats for each row of data in the report.
      • Cells – Cell repeats for each field in this row.
        • Cell As String – Represents each field on each row of this report.
  • CSV – exists if the CSV format type was specified.
    • A string containing the report in CSV format as described below:
      • Text-Delimiters: double-quotes
      • Record Separator: carriage return + line feed
      • Field Separator: comma
      • Headers: included
  • Filename As String - the file name if applicable
  • RowCount As Integer - number of rows returned

Examples

<Reports_Execute xmlns="http://api.myh2o.com/">
    <Request>
        <Session>
            <SessionKey>xyzabc123</SessionKey>
        </Session>
        <ReportID>1234</ReportID>
        <ClearCache>false</ClearCache>
        <Format>CSV</Format>
    </Request>
</Reports_Execute>
<Reports_ExecuteResult>
    <Header>
        <Success>true</Success>
        <SessionKey>xyzabc123</SessionKey>
    </Header>
    <CSV>
        "Agent_ID","Account_Number","Name"
        "100","TSI","Top Sales, Inc."
        "101","MAI","Master Agent, Inc."
        "102","RSTI","Rouge Sales Team, Inc."
    </CSV>
    <Filename>Agent List.csv</Filename>
    <RowCount>3</RowCount>
</Reports_ExecuteResult>
<Reports_Execute xmlns="http://api.myh2o.com/">
    <Request>
        <Session>
            <SessionKey>xyzabc123</SessionKey>
        </Session>
        <ReportID>1234</ReportID>
        <ClearCache>false</ClearCache>
        <Format>XML</Format>
    </Request>
</Reports_Execute>
<Reports_ExecuteResult>
    <Header>
        <Success>true</Success>
        <SessionKey>xyzabc123</SessionKey>
    </Header>
    <XML>
        <Columns>
            <Column>Agent_ID</Column>
            <Column>Account_Number</Column>
            <Column>Name</Column>
        </Columns>
        <Rows>
            <Cells>
                <Cell>100</Cell>
                <Cell>TSI</Cell>
                <Cell>Top Sales, Inc.</Cell>
            </Cells>
        </Rows>
        <Rows>
            <Cells>
                <Cell>101</Cell>
                <Cell>MAI</Cell>
                <Cell>Master Agent, Inc.</Cell>
            </Cells>
        </Rows>
        <Rows>
            <Cells>
                <Cell>102</Cell>
                <Cell>RSTI</Cell>
                <Cell>Rouge Sales Team, Inc.</Cell>
            </Cells>
        </Rows>
    </XML>
    <Filename>Agent List.xml</Filename>
    <RowCount>3</RowCount>
</Reports_ExecuteResult>

Reports_Query

Get information about an existing report.

Required Input

  • ID As Integer – the ID from Rev.io's My Reports or Shared Reports sections that you intend to run.

Output

  • Report – A normal report
    • ID As Integer – The Rev.io report ID.
    • CategoryID As Integer – The category ID of the report.
    • Description As String – The description of the report.
    • LongDescription As String – The long description of the report.
    • Columns – Indicates the columns that are returned from the report
      • Column – A single column
        • Name As String – Name of the column
        • Dataset As String – Dataset from which the column is obtained
    • WhereClause – Defines any filtering conditions for the report
      • Condition – Indicates how the filters or filter groups found in this object is grouped for filtering. ("all" or "at_least_one")
      • FilterGroups – List of child filter groups
      • Filters – List of filters
        • Filter – A single filter
          • ID As String – The ID of the filter.
          • Field As Column – The column and column source of the filter.
            • Name As String – The name of the column.
            • Schema As String – The source schema of the column.
          • Value As String – The default value of the column.
          • DataType As String – The value type of the filter. This will be one of the following:
            • Automatic – The type of value is automatically determined.
            • System.DateTime – The value must be a valid date.
            • System**.String** – The value must be a string.
            • System.Int32 – The value must be a 32-bit integer.
            • System.Int64 – The value must be a 64-bit integer.
            • System.Decimal – The value must be a numeric value.
            • System.Boolean – The value must be a boolean ("True" or "False").
            • System.Double – The value must be a numeric value.
          • Comparison As Operator – The operator of a value ("=", ">", etc.).
          • IsUserSupplied As Boolean – The operator of a value ("=", ">", etc.).
    • MaxResults As Integer – The maximum number of results to be returned. May be null for no limit.
    • IsShared As Boolean – Indicates if this is a shared report
    • DashboardReport As Boolean – Indicates if this is a Dashboard report
    • Query As String – If report is a SQL report it represents the SQL query to be executed, else it represents the main table or view to retrieve data.