This function returns a specified report in a printable format, instead of the default format. Request ElementsThe 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 "PRINT". | ReportId | Integer | An internal ID to specify the report that is to be returned in a printable format. |
Request ExampleThe following SOAP example shows the parameters that you can pass to this call: <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>PRINT</reportRequest>
<reportId>60712</reportId>
</arg0>
</web:remoteReportCall>
</soapenv:Body>
</soapenv:Envelope> |
Response ElementsThe response returned will contain these parameters: Response Element | Data Type | Description | Retrieval Code |
---|
Chart | Array (ReportChart) | Array of ReportChart objects that contains multiple chart bitmaps when attached to a HTML report response (see ReportChart) | getCharts()
| ReportBinaryObject | Array (ReportBinaryObject) | Array of ReportBinaryObject objects that contain BLOBs and CLOBs (see ReportBinaryObject) | getBinaryObjects()
| ReportStyles | String | CSS styles | getReportStyles()
| Breadcrumbs | Array (Breadcrumb) | Array of Breadcrumb objects | getBreadcrumbs()
| SeriesSelection | Array (SeriesSelection) | Array of SeriesSelection objects | getSeriesSelections()
| TimeAggregationSelection | Array (TimeAggregationSelection) | Array of TimeAggregationSelection objects | getTimeAggregationSelection()
| ReportTabSelection | Array (ReportTabSelection) | Array of ReportTabSelection objects | getReportTabSelection()
| ReportPageSelection | Array (ReportPageSelection) | Array of ReportPageSelection objects | getReportPageSelection()
| TimeSliderSelection | Array (TimeSliderSelection) | Array of TimeSliderSelection objects | getTimeSliderSelection()
| SortableColumns | Array (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 | Array (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 | Array (GMap) | Array of GMap objects | getGoogleMaps()
|
Response ExampleThe service will return the below response, according to our SOAP example: <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>PHN0eWxlIHR50iRlNfaW1hZ2VzX3Byb2Nlc ... </binaryData>
<canDrill>false</canDrill>
<category>Tutorial</category>
<charts>
<contentType>image/gif</contentType>
<data>R0lGODlhFAAUAJEAAP///43S/jSz/wAAACH5BAAHAP8ALAAAAAAUABQAAAJClI+pwe3fDJxP0msZ
AJNH4WyQ+IVes51BFpBa6rBu6q4g6tG1nOvx/cLBSjjTDthSJVW8ERNZQ/0uGCR1eoUottwCADs=</data>
<filename>FS_images_process_mini_rwd_off_gif</filename>
<reportIndex>FS_images_process_mini_rwd_off_gif</reportIndex>
</charts>
<charts>
<contentType>image/gif</contentType>
<data>R0lGODlhFAAUAJEAAP///43S/jSz/wAAACH5BAAHAP8ALAAAAAAUABQAAAI5lI+pwe3fDJxP0msv
gHmCXQnax4neBzpdg5Ih1Lqq6cRpRNdtSe1vL8NdAkHGCsYbTo7KAFOpiEoLADs=</data>
<filename>FS_images_process_mini_previous_off_gif</filename>
<reportIndex>FS_images_process_mini_previous_off_gif</reportIndex>
</charts>
<charts>
<contentType>image/gif</contentType>
<data>R0lGODlhFAAUAOYAAP///2PF/2HE/2DD/13B ...</data>
<filename>FS_images_process_mini_next_gif</filename>
<reportIndex>FS_images_process_mini_next_gif</reportIndex>
</charts>
.
.
.
<contentType>text/html</contentType>
<dashboardEnabled>true</dashboardEnabled>
<dataOutput>COLUMN</dataOutput>
<datasource>Ski Team</datasource>
<drillCode>NODRILL</drillCode>
<errorCode>0</errorCode>
<formatCode>REPORTANDCHART</formatCode>
<hitCount>0</hitCount>
<lastModifiedDate>2017-06-26</lastModifiedDate>
<lastRunStatus>RUN_NOERROR</lastRunStatus>
<messages>Successfully Authenticated User: admin@yellowfin.com.au</messages>
<messages>Loaded Report: 60712 Successfully</messages>
<messages>Generating HTML Report</messages>
<messages>Request Contains No ReportFilter Records.</messages>
<messages>AGENCYNAME (FilterId: 60723 ) Requires User Prompt</messages>
<messages>Report Run Successfully</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>
<relatedReports/>
<reportDescription>Top N Agencies compared to all other Agencies by demographic</reportDescription>
<reportId>60712</reportId>
<reportName>Agency Benchmark</reportName>
<reportPageSelection>
<hyperLink>PAGE|60712|ABS|0</hyperLink>
<pageTitle>1 - 100</pageTitle>
<reportId>60712</reportId>
<selected>true</selected>
</reportPageSelection>
<reportPageSelection>
<hyperLink>PAGE|60712|ABS|100</hyperLink>
<pageTitle>101 - 160</pageTitle>
<reportId>60712</reportId>
<selected>false</selected>
</reportPageSelection>
<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;
}
.
.
.
</reportStyle>
<reportTemplate>REPORTANDCHART</reportTemplate>
<reportUUID>c83357db-8aef-4ec7-ab72-fce34de9ee77</reportUUID>
<reportUsage>0</reportUsage>
<selectedSortColumn>-1</selectedSortColumn>
<selectedSortOrder>1</selectedSortOrder>
<sessionId>99ba02f7d8e0590185d7097c2e2f551a</sessionId>
<sortableColumns/>
<sortableColumns/>
<sortableColumns/>
<sortableColumns/>
<statusCode>SUCCESS</statusCode>
<subCategory>Marketing & Booking</subCategory>
<tags>No tags</tags>
<viewName>New View</viewName>
</return>
</ns2:remoteReportCallResponse>
</S:Body>
</S:Envelope> |
InstructionsSee below for step-by-step instructions on how to perform this call, using a Java example: If you need to specify the client org where the report exists, add this to your code:
rsr.setOrgRef("org1"); // search for the report in this client org |
Specify which report to convert into XLSX format:
Once the request is configured, carry out the call:
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 including, StatusCode, ReportID, BinaryData, etc. (See the Response Parameters table above for more details.)
|
Complete ExampleBelow is a full example of this function. To use it for yourself, carry out the following the steps: - Copy the code and save it as ws_xlsxreport.jsp.
- Put the file in the root folder, which is Yellowfin/appserver/webapps/ROOT.
- Adjust host, port, and admin user to add details according to your environment.
- Run http://<host>:<port>/ws_xlsxreport.jsp from your Internet browser.
/* ws_xlsxreport.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" %>
<%
/*
Create Group
Using Java generated stubs rather that using the Yellowfin webservices API..
*/
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("XLSX");
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());
}
%>
|
|