Skip to Content

Retrieval of Crystal Report Meta Data using REST API

This API  will retrieve Metadata from a crystal report. The response will include following information:

  • Database connection, tables, aliases, joins, fields used in the document and all its associated properties. It should list fields from CrossTabs as well (see Response format)
  • Parameters of the report
  • Formula fields of the report
  • Parameter fields of the report
  • Special fields of the report
  • Filters and all expressions, calculations involved in the report
  • It will contain similar information for sub reports as well

The URI is:  http://<baseURI>/infostore/<reportID>/rpt/structure
Make a GET request to retrieve the report summary information.
Request:
Method: GET
URI: http://<baseURI>/infostore/<reportID>/rpt/structure
Request header attributes: X-SAP-LogonToken
Request body: none


Note: Pre-Requisite for retrieving metadata is to Logon to RestService with below URL and set the header with X-SAP-LogonToken

http://BOEServerIP:6405/biprws/logon/long

Response:
The response contains report summary as shown below:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns17:reportstructure xmlns:ns2="http://www.sap.com/rws/cr/connection" xmlns:ns3="http://www.sap.com/rws/cr/dbfield" xmlns:ns4="http://www.sap.com/rws/cr/table" xmlns:ns5="http://www.sap.com/rws/cr/datasource"xmlns:ns6="http://www.sap.com/rws/cr/fieldlink" xmlns:ns7="http://www.sap.com/rws/cr/join" xmlns:ns8="http://www.sap.com/rws/cr/datasources" xmlns:ns9="http://www.sap.com/rws/cr/usedfield" xmlns:ns10="http://www.sap.com/rws/cr/parameter"xmlns:ns11="http://www.sap.com/rws/cr/parametergroup" xmlns:ns12="http://www.sap.com/rws/cr/parameters" xmlns:ns13="http://www.sap.com/rws/cr/formula" xmlns:ns14="http://www.sap.com/rws/cr/groupcondition"xmlns:ns15="http://www.sap.com/rws/cr/summaryfield" xmlns:ns16="http://www.sap.com/rws/cr/runningtotalfield" xmlns:ns17="http://www.sap.com/rws/cr/reportstructure">
<datasources>
<datasource>
<datasourcename>10.160.192.101 - Oracle12c_JDBC_Connection_5</datasourcename>
<connection>
<cuid>AUy28zmbGthPtalH6n3Gshg</cuid>
<kind>SQL</kind>
<networklayer>JDBC</networklayer>
<database>Oracle 12</database>
</connection>
<tables>
<table>
<name>CUSTOMER</name>
<tablekind>SQL_Table</tablekind>
<dbfields>
<dbfield>
<name>CUST_ID</name>
<kind>SQL_Field</kind>
<datatype>decimal</datatype>
<technicalname>CUST_ID</technicalname>
<qualifiedname>CUSTOMER.CUST_ID</qualifiedname>
</dbfield>
<dbfield>
<name>FIRST_NAME</name>
<kind>SQL_Field</kind>
<datatype>string</datatype>
<technicalname>FIRST_NAME</technicalname>
<qualifiedname>CUSTOMER.FIRST_NAME</qualifiedname>
</dbfield>
<dbfield>
<name>LAST_NAME</name>
<kind>SQL_Field</kind>
<datatype>string</datatype>
<technicalname>LAST_NAME</technicalname>
<qualifiedname>CUSTOMER.LAST_NAME</qualifiedname>
</dbfield>
<dbfield>
<name>AGE</name>
<kind>SQL_Field</kind>
<datatype>decimal</datatype>
<technicalname>AGE</technicalname>
<qualifiedname>CUSTOMER.AGE</qualifiedname>
</dbfield>
<dbfield>
<name>PHONE_NUMBER</name>
<kind>SQL_Field</kind>
<datatype>string</datatype>
<technicalname>PHONE_NUMBER</technicalname>
<qualifiedname>CUSTOMER.PHONE_NUMBER</qualifiedname>
</dbfield>
<dbfield>
<name>ADDRESS</name>
<kind>SQL_Field</kind>
<datatype>string</datatype>
<technicalname>ADDRESS</technicalname>
<qualifiedname>CUSTOMER.ADDRESS</qualifiedname>
</dbfield>
<dbfield>
<name>CITY_ID</name>
<kind>SQL_Field</kind>
<datatype>decimal</datatype>
<technicalname>CITY_ID</technicalname>
<qualifiedname>CUSTOMER.CITY_ID</qualifiedname>
</dbfield>
<dbfield>
<name>SALES_ID</name>
<kind>SQL_Field</kind>
<datatype>decimal</datatype>
<technicalname>SALES_ID</technicalname>
<qualifiedname>CUSTOMER.SALES_ID</qualifiedname>
</dbfield>
<dbfield>
<name>SPONSOR_ID</name>
<kind>SQL_Field</kind>
<datatype>decimal</datatype>
<technicalname>SPONSOR_ID</technicalname>
<qualifiedname>CUSTOMER.SPONSOR_ID</qualifiedname>
</dbfield>
</dbfields>
</table>
<table>
<name>CITY</name>
<tablekind>SQL_Table</tablekind>
<dbfields>
<dbfield>
<name>CITY_ID</name>
<kind>SQL_Field</kind>
<datatype>decimal</datatype>
<technicalname>CITY_ID</technicalname>
<qualifiedname>CITY.CITY_ID</qualifiedname>
</dbfield>
<dbfield>
<name>CITY</name>
<kind>SQL_Field</kind>
<datatype>string</datatype>
<technicalname>CITY</technicalname>
<qualifiedname>CITY.CITY</qualifiedname>
</dbfield>
<dbfield>
<name>REGION_ID</name>
<kind>SQL_Field</kind>
<datatype>decimal</datatype>
<technicalname>REGION_ID</technicalname>
<qualifiedname>CITY.REGION_ID</qualifiedname>
</dbfield>
</dbfields>
</table>
</tables>
</datasource>
<joins>
<join>
<sourcetable>CUSTOMER</sourcetable>
<kind>FullOuter</kind>
<targettable>CITY</targettable>
<fieldlinks>
<fieldlink>
<fromfield>
<name>CITY_ID</name>
<kind>DatabaseField</kind>
<datatype>decimal</datatype>
</fromfield>
<fieldlinkOperator>NotEqual</fieldlinkOperator>
<tofield>
<name>CITY_ID</name>
<kind>DatabaseField</kind>
<datatype>decimal</datatype>
</tofield>
</fieldlink>
</fieldlinks>
</join>
</joins>
</datasources>
<usedfields>
<usedfield fieldtype="DatabaseField" uniqueid="{CITY.CITY}" name="CITY"/>
<usedfield fieldtype="DatabaseField" uniqueid="{CUSTOMER.FIRST_NAME}" name="FIRST_NAME"/>
<usedfield fieldtype="DatabaseField" uniqueid="{CUSTOMER.LAST_NAME}" name="LAST_NAME"/>
</usedfields>
</ns17:reportstructure>

Former Member