RunReportXml

Description

This service runs a specified report for a user, given the proper privileges.

Arguments

Argument Type Description
auth (optional) Auth The Auth type supplies credentials and optionally, a host name for licensing. The userId and password can be specified with HTTP BASIC or WS-SECURITY instead.
report (required) ReportData Specifies the report to run.
options Options In the options argument, you can specify an XSL stylesheet to transform the resultant XML. You can also specify that the results are returned in a .zip file (in base64 encoded format).

You can also include extraOption elements to specify a query at runtime report. See the Usage notes below.

Response

RunReportXmlResult is returned. The report contents are returned in XML format by default. For more detail, see RunReportXmlResult.

Usage

The RunReportXml call executes a given report, assuming you have the proper privilege. Use the GetReports call to return a list of available reports without actually running any of the reports themselves. Once you identify the desired report, use RunReportXml or RunReport (which only executes Listing reports) to execute the report.

The RunReportXML call enables you to specify a stylesheet in the options parameter to transform the XML result into a report that is similar to what is displayed in SBM User Workspace. You must specify a report stylesheet located on the Application Engine server here: installDir\SBM\Application Engine\template. You can also specify an additional parameter to have Listing report results returned in a base64 encoded .zip file. For example, to transform the XML using the Excel.xsl stylesheet provided with SBM and zip the payload, send the following:
<urn:options>
    <urn:extraOption>
        <urn:name>XSLStyleSheet</urn:name>
        <urn:value>xsl/Excel.xsl</urn:value>
    </urn:extraOption>
    <urn:extraOption>
        <urn:name>zip</urn:name>
    </urn:extraOption>
</urn:options>
Note: In order to run a Built-in report, you must use RunReport. For details, see RunReport. This call is deprecated for all uses other than running Built-in reports.

An advanced usage of the RunReportXML call involves passing extraOptions that execute a Query At Runtime report. To execute a Query At Runtime report, you must have the report ID and the field ID(s) that are used on the Query At Runtime report form. You can find the field IDs by inspecting the Query At Runtime page in the Web browser. Enter the field ID in the <urn:name> element and the field value you are using for your query in the <urn:value> element. For a detailed example, see solution S141151.

The following XML example shows the <urn:extraOptions> and sample field IDs.

<urn:options>
    <urn:extraOption>
	       <urn:name>F67v1</urn:name>
	       <urn:value>Your Value</urn:value>
    </urn:extraOption> 
    <urn:extraOption>
        <urn:name>F70v1</urn:name>
        <urn:value>Your Other Value</urn:value>
    </urn:extraOption> 
    <urn:extraOption>
        <urn:name>HasRuntimeParams</urn:name>
        <urn:value>1</urn:value>
    </urn:extraOption>
</urn:options>

Faults

XML

The following XML is a snippet of the payload that is sent with RunReportXml.

<urn:RunReportXml>
    <urn:auth>
        <urn:userId>admin</urn:userId>
        <urn:password></urn:password>
        <urn:hostname></urn:hostname>
        <urn:loginAsUserId></urn:loginAsUserId>
        <urn:extendedData></urn:extendedData>
    </urn:auth>
    <urn:report>
        <urn:id>47</urn:id>
        <urn:reportReference></urn:reportReference>
    </urn:report>
    <urn:options>
    <urn:extraOption>
        <urn:name>XSLStyleSheet</urn:name>
        <urn:value>xsl/Excel.xsl</urn:value>
    </urn:extraOption>
    <urn:extraOption>
        <urn:name>zip</urn:name>
    </urn:extraOption>
    </urn:options>
</urn:RunReportXml>