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.

These report web services allow users to return a report in a specified format, such as HTML, PDF, XLS, DOC, etc. The PRINT function returns the report in a printable format.


Anchor
html
html

Expand
titleHTML / HTMLCHARTONLY / HTMLTABLEONLY

The HTML request will return an HTML representation of the report. The HTML document will be stored in the BinaryData parameter, as Base64 encoded data. The report's charts and/or images will be stored in an array of Chart parameters. These artefacts will need to be manually decoded by the client system, and the URL request string is used to embed the URL within the HTML for decoding the Base64 images.

There are three HTML related web services that display slightly varying HTML documents:

  • HTML: This will return the chart and table in the HTML format, if both exist.
  • HTMLCHARTONLY: This service only returns the chart of the report in the HTML format.
  • HTMLTABLEONLY: This service only returns the report table in the HTML format.

 

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 "HTML", "HTMLCHARTONLY" or "HTMLTABLEONLY".

ReportIdIntegerAn internal ID to specify the report to be returned as an HTML representation.


 

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>HTML</reportRequest>
            <reportId>58511</reportId>
            </arg0>
      </web:remoteReportCall>
   </soapenv:Body>
</soapenv:Envelope>

 

 

Response Elements

The response will contain these main parameters:

Response Element

Data Type

Description

Retrieval Code

Chart

ReportChart[]

Array of ReportChart objects that contains multiple chart bitmaps when attached to a HTML report response.

getCharts()

ReportBinaryObject

ReportBinaryObject[]

Array of ReportBinaryObject objects that contain BLOBs and CLOBs.

getBinaryObjects()

ReportStyles

String

CSS styles.

getReportStyles()

Breadcrumbs

Breadcrumb[]

Array of Breadcrumb objects.

getBreadcrumbs()

SeriesSelection

SeriesSelection[]

Array of SeriesSelection objects.

getSeriesSelections()

TimeAggregationSelection

TimeAggregationSelection[]

Array of TimeAggregationSelection objects.

getTimeAggregationSelection()

ReportTabSelection

ReportTabSelection[]

Array of ReportTabSelection objects.

getReportTabSelection()

ReportPageSelection

ReportPageSelection[]

Array of ReportPageSelection objects.

getReportPageSelection()

TimeSliderSelection

TimeSliderSelection[]

Array of TimeSliderSelection objects.

getTimeSliderSelection()

SortableColumns

SortableTableColumn[]

Array of SortableTableColumn objects.

getSortableColumns()

SelectedSortColumn

Integer

Column used for sorting. The index here applies to the column index within the report.

getSelectedSortColumn()

SelectedSortOrder

Integer

The sort order of the column used for sorting (0 for ascending and 1 for descending).

getSelectedSortOrder()

DrillCode

String

Drill type if available on the report.

getDrillCode()

RelatedReports

RelatedReport[]

Array of RelatedReport objects. These are reports that are tabbed/codisplayed to the main report.

getRelatedReports()

BinaryData

String

Base64 encoded binary chunk of the HTML document.

getBinaryData()

Private

 

Determines if the report is a private or a public one.

getPrivate()

ContentType

String

MIME ContentType of the returned object. Value will be “text/html”.

getContentType()

CanDrill

Boolean

If the report is able to drill or not.

getCanDrill()

GoogleMaps

GMap

Array of GMap objects.

getGoogleMaps()

 

 

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>0</averageRunTime>
            <binaryData>PHN0eWxlIHR5cGU9InRleHQvY3NzIj4KLm11bHRpV2lkZ2V0Q2FudmFzRWRpdG9yIH ... </binaryData>
            <canDrill>false</canDrill>
            <category>Audit Reports</category>
            <charts>
               <contentType>image/gif</contentType>
               <data>R0lGODlhBwAEAIABAP///////yH5BAEAAAEALAAAAAAHAAQAAAIIhA+BGWoNWSgAOw== ... </data>
               <filename>FS_images_rpt_dd_active_down_gif</filename>
               <reportIndex>FS_images_rpt_dd_active_down_gif</reportIndex>
            </charts>
            <charts>
               <contentType>image/gif</contentType>
               <data>R0lGODlhBwAEAIABABo/V////yH5BAEAAAEALAAAA ... </data>
               <filename>FS_images_rpt_dd_menu_on_gif</filename>
               <reportIndex>FS_images_rpt_dd_menu_on_gif</reportIndex>
            </charts>
            <charts>
               <contentType>image/png</contentType>
               <data>iVBORw0KGgoAAAANSUhEUgAAAyAAAAJYCAYAAACadoJ ... </data>
               <filename>img0-58511-58512-0</filename>
               <reportIndex>img0-58511-58512-0</reportIndex>
            </charts>
            <contentType>text/html</contentType>
            <dashboardEnabled>true</dashboardEnabled>
            <dataOutput>COLUMN</dataOutput>
            <datasource>Yellowfin Configuration Database</datasource>
            <drillCode>NODRILL</drillCode>
            <errorCode>0</errorCode>
            <formatCode>REPORTANDCHART</formatCode>
            <hitCount>8</hitCount>
            <lastModifiedDate>2016-04-13</lastModifiedDate>
            <lastRunDuration>0</lastRunDuration>
            <lastRunStatus>RUN_NOERROR</lastRunStatus>
            <messages>Successfully Authenticated User: admin@yellowfin.com.au</messages>
            <messages>Loaded Report: 58511 Successfully</messages>
            <messages>Generating HTML Report</messages>
            <messages>Request Contains No ReportFilter Records.</messages>
            <messages>Report Run Successfully</messages>
            <messages>Web Service Request Complete</messages>
            <private>false</private>
            <relatedReports/>
            <reportDescription/>
            <reportId>58511</reportId>
            <reportName>Role Population</reportName>
            <reportStyle>td.rpthdrcol {
   position: relative;
}
img.rptcolmenu {
   position: absolute;
   right: 5px;
   top: 0;
   bottom: 0;
   margin: auto 0;
   cursor: pointer;
}
td.rpthdrcol div.rptdata {
   padding-right: 20px;
}
td.reportChartCell {
   vertical-align: top;
}
div.reportChart {
   position: relative;
   display: inline-block;
}
img.reportChart {
   position: absolute;
   left: 0;
   top: 0;
}
.
.
.
</reportStyle>
            <reportTemplate>REPORTANDCHART</reportTemplate>
            <reportUUID>00c65743-15f8-4f93-ace1-e3d4d2b956eb</reportUUID>
            <reportUsage>14</reportUsage>
            <selectedSortColumn>-1</selectedSortColumn>
            <selectedSortOrder>0</selectedSortOrder>
            <sessionId>c4ae62bf45978bf6910c1f4c81c478b0</sessionId>
            <sortableColumns/>
            <sortableColumns/>
            <statusCode>SUCCESS</statusCode>
            <subCategory>User Access</subCategory>
            <tags>No tags</tags>
            <viewName>NEW VIEW</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("HTML");


  • 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



  • Specify which report to convert into HTML format:

    Code Block
    languagejava
    rsr.setReportId(60712);



  • 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 parameters related to the report. (See the Response Parameters table above for more 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_htmlreport.jsp.
  2. Put the file in the root folder, which is Yellowfin/appserver/webapps/ROOT.
  3. Adjust host, port, and admin user to add details according to your environment.
  4. Run http://<host>:<port>/ws_htmlreport.jsp from your Internet browser.

 

Code Block
languagejava
themeEclipse
/*				ws_htmlreport.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.setReportRequest("HTML");
	rsr.setOrgRef("1");
	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());
	} 
%>

  


 

...