Like what you see? Have a play with our trial version.

Error rendering macro 'rw-search'

null

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleSCHEMA

This web service returns schematic information of a specified report, which includes metadata for report columns and filters as well. A report needs to be specified by either providing its ID or by its web service name.

 

Request Elements

The following elements will be passed with this request:

Request Element

Data Type

Description

LoginId

String

Yellowfin web services administrator user Id. This can be the user ID or the email address, depending on the Logon ID method.

This Yellowfin account must have the “web services” role enabled, and must belong to the Default (i.e. Primary) Org.

Password

String

Password of the above account.

OrgId

Integer

Default (i.e. Primary) organization ID within Yellowfin. Always set this to 1.

ReportRequest

String

Web services function. Set this to "SCHEMA".

OrgRef

String

Client Org internal reference ID (optional).

ReportIdIntegerYou can provide a The internal report ID to search for a particular report. The report ID changes every time a report is modified. Tip: you can use the GETIDFROMUUID function to get the relevant report ID.
ObjectNameString(Optional) The web service name of the report. This is not needed if the report ID is provided.


 

Request Example

The following SOAP example shows the parameters that you can pass to this call:

Code Block
languagexml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.web.mi.hof.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <web:remoteReportCall>
         <arg0>
            <loginId>admin@yellowfin.com.au</loginId>
            <password>test</password>
            <orgId>1</orgId>
            <reportRequest>SCHEMA</reportRequest>
            <reportId>60712</reportId>
            </arg0>
      </web:remoteReportCall>
   </soapenv:Body>
</soapenv:Envelope>

 

 

Response Elements

The response returned will contain these main parameters:

ID of the specified reportgetViewName()Array of ReportChart objects that contains multiple chart bitmaps when attached to a HTML report response

Response Element

Data Type

Description

Retrieval Code

ReportId

Integer

getReportId()

StatusCode

String

Status of the web service request

getStatusCode()

FormatCode

String

Format code of the specified report

getFormatCode()

ReportType

String

Report type of the specified report

getReportType()

LastRunStatus

String

Status code of last report run

getLastRunStatus()

LastRunTime

Decimal

Last report run time in the format of YYYYMMDDHHMMSS

getLastRunTime()

ReportName

String

Name of the specified report

getReportName()

BinaryData

String

Base64 encoded binary chunk of image, HTML, CSV, or PDF

getBinaryData()

. Possible values include:

  • SUCCESS
  • FAILURE

Columns

ReportSchema[]

Array of ReportSchema objects that contain information (metadata) on each column in the report result set, and whether the report requires user prompt filter data to be passed to it. See the below table for more details.

Author

String

Name of the user to wrote the report.

AuthoringMode

String


AverageRunTime

Integer


CanDrill

Boolean

Whether or not the report has any drill functionality enabled.

Category

String

Name of the folder the report is saved in.

SubCategory

String

Name of the sub-folder the report is saved in.

DashboardEnabled

Boolean


DataOutput

String

One of:

  • COLUMN
  • ROW
  • PIVOT

Datasource

String

Report data source name

DrillCode

String

Drill type if available on the report. One of:

  • DRILLDOWN
  • DRILLTHROUGH
  • DRILLANYWHERE

FormatCode

String

Format code of the specified report. One of:

  • REPORTANDCHART
  • CHART
  • REPORT

ViewName

String

Name of view that the report depends on

HitCount

Integer

Number of times the specified report has been accessed.

getHitCount()

DrillCodeLastModifiedDate

String

Date when report was last modified.

LastRunDuration

Integer


PreRunFilterString

String

Drill type if available on the report

getDrillCode()


Private

 Boolean

Determines if the report is a private or a public one

getPrivate()

Results

ReportRow

Array of ReportRow objects that contain results in the report result set (see ReportRow)

getResults()

. (Private for Legacy services)

ReportDescription

String


ReportId

Integer

ID of the specified report.

ReportName

String

Name of the specified report.

ReportTemplate

String

One of:

  • REPORTANDCHART
  • CHART
  • REPORT

ReportUUID

String

UUID of the report.

ReportUsage

Integer


ViewName

String

Name of view that the report depends on.

Tags

String


ErrorCode

Integer

ContentType

String

MIME ContentType of the returned object. Possible values include:

  • “text/html”
  • “text/comma-separated-values”
  • “image/png”
  • “application/pdf”

getContentType()


Messages

String[]

Array of Strings that show debug information as the report is run on the server. Used for debugging and tracing errors

getMessages()

Charts

ReportChart[]

.

getCharts()

Columns

ReportSchema[]

Array of ReportSchema objects that contain information on each column in the report result set, and whether the report requires user prompt filter data to be passed to it.

getColumns()

 




 

Response Example

The service will return the below response, according to our SOAP example:

Code Block
languagexml
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:remoteReportCallResponse xmlns:ns2="http://webservices.web.mi.hof.com/">
         <return>
            <author>System Administrator</author>
            <authoringMode>JAVA</authoringMode>
            <averageRunTime>1</averageRunTime>
            <canDrill>false</canDrill>
            <category>Tutorial</category>
            <columns>
               <columnName>TopN</columnName>
               <dataType>TEXT</dataType>
               <displayName>Top N</displayName>
               <fieldId>3</fieldId>
               <hidden>false</hidden>
               <numberOfDecimals>0</numberOfDecimals>
               <outputLocation>COLUMN</outputLocation>
               <prompt>false</prompt>
               <sortOrder>0</sortOrder>
            </columns>
            <columns>
               <columnName>AGENCYNAME</columnName>
               <dataType>TEXT</dataType>
               <displayName>Company Name</displayName>
               <fieldId>4</fieldId>
               <hidden>false</hidden>
               <numberOfDecimals>0</numberOfDecimals>
               <outputLocation>COLUMN</outputLocation>
               <prompt>false</prompt>
               <sortOrder>1</sortOrder>
            </columns>
            <columns>
               <columnName>DEMOGRAPHIC</columnName>
               <dataType>TEXT</dataType>
               <displayName>Demographic</displayName>
               <fieldId>1</fieldId>
               <hidden>false</hidden>
               <numberOfDecimals>0</numberOfDecimals>
               <outputLocation>COLUMN</outputLocation>
               <prompt>false</prompt>
               <sortOrder>2</sortOrder>
            </columns>
            <columns>
               <columnName>FormulaBuilderMetric</columnName>
               <dataType>NUMERIC</dataType>
               <displayName>Sum Invoiced (Pref Currency)</displayName>
               <fieldId>2</fieldId>
               <hidden>false</hidden>
               <numberOfDecimals>0</numberOfDecimals>
               <outputLocation>COLUMN</outputLocation>
               <prompt>false</prompt>
               <sortOrder>3</sortOrder>
            </columns>
            <columns>
               <allowPrompt>true</allowPrompt>
               <cachedValues>false</cachedValues>
               <columnName>AGENCYNAME</columnName>
               <dataType>TEXT</dataType>
               <displayName>Company Name</displayName>
               <filterDisplayType>TEXT</filterDisplayType>
               <filterId>60723</filterId>
               <filterOmittable>true</filterOmittable>
               <filterType>INLIST</filterType>
               <filterTypeCode>FILTER</filterTypeCode>
               <filterUUID>d3aaf0e4-4b67-4118-9871-7dc98933e4e3</filterUUID>
               <numberOfDecimals>0</numberOfDecimals>
               <prompt>true</prompt>
               <sortOrder>1</sortOrder>
            </columns>
            <dashboardEnabled>true</dashboardEnabled>
            <dataOutput>COLUMN</dataOutput>
            <datasource>Ski Team</datasource>
            <drillCode>NODRILL</drillCode>
            <errorCode>0</errorCode>
            <formatCode>REPORTANDCHART</formatCode>
            <hitCount>2</hitCount>
            <lastModifiedDate>2017-06-26</lastModifiedDate>
            <lastRunDuration>0</lastRunDuration>
            <messages>Successfully Authenticated User: admin@yellowfin.com.au</messages>
            <messages>Loaded Report: 60712 Successfully</messages>
            <messages>Collating Schema Information</messages>
            <messages>Web Service Request Complete</messages>
            <preRunFilterString><![CDATA[<div class="rptFilterLogicText">
<span class="rptFilterLogicIdentifier">Company Name</span>
In List
<span class="rptFilterLogicIdentifier">[User Prompt]</span>
</div>]]></preRunFilterString>
            <private>false</private>
            <reportDescription>Top N Agencies compared to all other Agencies by demographic</reportDescription>
            <reportId>60712</reportId>
            <reportName>Agency Benchmark</reportName>
            <reportTemplate>REPORTANDCHART</reportTemplate>
            <reportUUID>c83357db-8aef-4ec7-ab72-fce34de9ee77</reportUUID>
            <reportUsage>9</reportUsage>
            <sessionId>da57441eaf7852ad59888e95775735fd</sessionId>
            <statusCode>SUCCESS</statusCode>
            <subCategory>Marketing &amp; Booking</subCategory>
            <tags>No tags</tags>
            <viewName>Ski Team</viewName>
         </return>
      </ns2:remoteReportCallResponse>
   </S:Body>
</S:Envelope>

 

Instructions

See below for step-by-step instructions on how to perform this call, using a Java example:

Expand
titleStep-by-step instructions
  • Here's a basic request to perform this call, which includes logging in as the admin user and specifying the web service call to perform:

    Code Block
    languagejava
    ReportServiceRequest rsr = new ReportServiceRequest();
    
    rsr.setLoginId("admin@yellowfin.com.au");
    rsr.setPassword("test");
    rsr.setOrgId(new Integer(1));
    
    rsr.setReportRequest("INFO");


  • If you need to specify the client org where the report exists, add this to your code:

    Code Block
    languagejava
    rsr.setOrgRef("org1");      // search for the report in this client org


  • You can even specify which report's comment to change the status of:

    Code Block
    languagejava
    rsr.setReportId(60712);



  • You may even specify the report client Reference ID or session ID:

    Code Block
    languagejava
    rsr.setReportClientReferenceId("1");
    rsr.setSessionId("18607a5670842650d512976b5d7ccddd");


  • Once the request is configured, carry out the call:

    Code Block
    languagejava
    ReportServiceResponse rs=rsc.remoteReportCall(rsr);

    Initialize the Report web service. Click here to learn how to do this. 

 

  • The response returned will contain the StatusCode parameter, along with other report specific parameters. Refer to the Response Parameter table above for details.

 


Complete Example

Below is a full example of this function. To use it for yourself, carry out the following the steps:

  1. Copy the code and save it as ws_reportschema.jsp.
  2. Put the file in the root folder, which is Yellowfin/appserver/webapps/ROOT.
  3. Adjust host, port, and admin user details according to your environment.
  4. Run http://<host>:<port>/ws_reportschema.jsp from your Internet browser.

 

Code Block
languagejava
themeEclipse
<%           
/*              ws_reportschema.jsp              */
%>
 
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="com.hof.util.*, java.util.*, java.text.*" %> 
<%@ page import="com.hof.web.form.*" %>
<%@ page import="com.hof.mi.web.service.*" %>
<%@ page import="javax.xml.bind.JAXBContext" %>
<%@ page import="javax.xml.bind.Marshaller" %>
<%@ page import="java.io.StringWriter" %>
<%@ page import="javax.xml.bind.JAXBElement" %>
<%@ page import="javax.xml.namespace.QName" %>
<%

ReportService rsc = new ReportService();   //("localhost", 8080, "admin@yellowfin.com.au", "test", "/services/ReportService");
	ReportServiceRequest rsr = new ReportServiceRequest();
	rsr.setLoginId("admin@yellowfin.com.au");
	rsr.setPassword("test");
	rsr.setOrgId(new Integer(1));
	rsr.setOrgRef("1");
	rsr.setReportRequest("SCHEMA");
	rsr.setReportId(60712);
	rsr.setReportClientReferenceId("1");
	ReportServiceResponse rs=rsc.remoteReportCall(rsr);
	if ("SUCCESS".equals(rs.getStatusCode())) {
		
		  JAXBContext context = JAXBContext.newInstance(ReportServiceResponse.class);
	        Marshaller m = context.createMarshaller();
	        m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); // To format XML
	        JAXBElement<ReportServiceResponse> rootElement = new JAXBElement<ReportServiceResponse>(new QName("ReportServiceResponse"), ReportServiceResponse.class, rs);
	        m.marshal(rootElement,out);    
		//out.write("Success");
	} else {
		out.write("Failure");
		out.write(" Code: " + rs.getErrorCode());
	}  
%>

 


 

...