HTMLリクエストは、レポートをHTMLで表現したものを返します。HTMLドキュメントはBase64でエンコードされ、BinaryDataパラメーター内に保存されます。レポートのグラフとイメージは、Chartパラメーターの配列に保存されます。これらのアーティファクトは、クライアントシステムにより手動でデコードする必要があります。また、HTMLリクエストは、HTMLで表現したレポートを返します。HTMLドキュメントはBase64でエンコードされ、BinaryDataパラメーター内に保存されます。レポートのグラフとイメージは、Chartパラメーターの配列に保存されます。これらのアーティファクトは、クライアントシステムにより手動でデコードする必要があります。また、URLリクエスト文字列は、Base64イメージのデコードのために、HTML内にURLを埋め込むために使用されます。 HTMLに関連するwebサービスは3つあり、それぞれわずかに異なるHTMLドキュメントを表示します。HTML:グラフと表の両方が存在する場合に、これをHTML形式で返します。 - HTML:グラフと表の両方が存在する場合に、これをHTML書式で返します。
HTMLCHARTONLY:レポート内のグラフのみをHTML形式で返します。- HTMLCHARTONLY:レポート内のグラフのみをHTML書式で返します。
HTMLTABLEONLY:レポートの表のみをHTML形式で返します。- HTMLTABLEONLY:レポートの表のみをHTML書式で返します。
リクエスト要素以下の要素は、こちらのリクエストとともに渡されます。 リクエスト要素 | データ型 | 説明 | LoginId | String | Yellowfin Webサービスの管理者ユーザーIDです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。 このYellowfinアカウントは、「Yellowfin Webサービス使用権」が有効化されたロールを持ち、デフォルト(プライマリー)組織に所属していなくてはいけません。 | Password | String | 上記アカウントのパスワードです。 | OrgId | Integer | Yellowfin内のデフォルト(プライマリー)組織IDです。常に、「1」に設定します。 | ReportRequest | String | webサービス関数です。「HTML」、「HTMLCHARTONLY」、または「HTMLTABLEONLY」に設定します。HTML」、「HTMLCHARTONLY」、または「HTMLTABLEONLY」に設定します。 | ReportId | Integer | HTML形式で返すレポートを特定するための内部IDです。HTML書式で返すレポートを指定するための内部IDです。 |
リクエストの例以下のSOAPの例は、こちらの呼び出しに渡すことのできるパラメーターを示しています。 Code Block |
---|
| <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> |
応答要素応答には、これらの主要なパラメーターが含まれます。 応答要素 | データ型 | 説明 | 取得コード | Chart | ReportChart[] | HTMLレポート応答に付加される、複数のグラフビットマップを含むReportChartオブジェクトの配列です。 | getCharts()
| ReportBinaryObject | ReportBinaryObject[] | BLOB、およびCLOBを含む、ReportBinaryObjectオブジェクトの配列です。 | getBinaryObjects()
| ReportStyles | String | CSSスタイルです。 | getReportStyles()
| Breadcrumbs | Breadcrumb[] | Breadcrumbオブジェクトの配列です。 | getBreadcrumbs()
| SeriesSelection | SeriesSelection[] | SeriesSelectionオブジェクトの配列です。 | getSeriesSelections()
| TimeAggregationSelection | TimeAggregationSelection[] | TimeAggregationSelectionオブジェクトの配列です。 | getTimeAggregationSelection()
| ReportTabSelection | ReportTabSelection[] | ReportTabSelectionオブジェクトの配列です。 | getReportTabSelection()
| ReportPageSelection | ReportPageSelection[] | ReportPageSelectionオブジェクトの配列です。 | getReportPageSelection()
| TimeSliderSelection | TimeSliderSelection[] | TimeSliderSelectionオブジェクトの配列です。 | getTimeSliderSelection()
| SortableColumns | SortableTableColumn[] | SortableTableColumnオブジェクトの配列です。 | getSortableColumns()
| SelectedSortColumn | Integer | 並べかえに使用するカラム(列)です。このインデックスは、レポート内のカラム(列)インデックスに適用されます。 | getSelectedSortColumn()
| SelectedSortOrder | Integer | 並べかえに使用するカラム(列)の並べかえ順序です(0が昇順、1が降順です)。 | getSelectedSortOrder()
| DrillCode | String | レポートで使用可能な場合の、ドリルタイプです。 | getDrillCode()
| RelatedReports | RelatedReport[] | RelatedReportオブジェクトの配列です。これは、メインレポートにタブ化、またはマルチ表示されるレポートです。 | getRelatedReports()
| BinaryData | String | Base64でエンコードされた、HTMLドキュメントのバイナリーチャンクです。 | getBinaryData()
| Private | | レポートが非公開、または公開のどちらであるかを定義します。 | getPrivate()
| ContentType | String | 返されるオブジェクトのMIME ContentTypeです。値は「text / html」です。 | getContentType()
| CanDrill | Boolean | レポートのドリル可否です。 | getCanDrill()
| GoogleMaps | GMap | GMapオブジェクトの配列です。 | getGoogleMaps()
|
応答の例サービスは、今回のSOAPの例に基づき、以下の応答を返します。 Code Block |
---|
| <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> |
手順Javaの例を使用して、こちらの呼び出しを実行するための詳細な手順は、以下を参照してください。 Expand |
---|
| 管理ユーザーとしてのログインと、実行するwebサービスの呼び出しの指定を含む、こちらの呼び出しを実行するための基礎的なリクエストです。
Code Block |
---|
| ReportServiceRequest rsr = new ReportServiceRequest();
rsr.setLoginId("admin@yellowfin.com.au");
rsr.setPassword("test");
rsr.setOrgId(new Integer(1));
rsr.setReportRequest("HTML"); |
レポートの保存されているクライアント組織を指定する必要がある場合は、こちらのコードを追加します。 Code Block |
---|
| rsr.setOrgRef("org1"); // search for the report in this client org |
HTML書式に変換するレポートを指定します。 Code Block |
---|
| rsr.setReportId(60712); |
リクエストを構成したら、呼び出しを実行します。
Code Block |
---|
| ReportServiceResponse rs=rsc.remoteReportCall(rsr); |
レポートwebサービスを初期化します。実行方法の詳細は、こちらを参照してください。
|
完成例以下は、こちらの関数の完成例です。こちらを使用するには、以下の手順に従います。 - コードをコピーして、「ws_htmlreport.jsp」として保存します。
- root(Yellowfin/appserver/webapps/ROOT)フォルダーにファイルを配置します。
- 環境に応じて、ホスト、ポート番号、管理ユーザーの詳細を調整します。
- インターネットブラウザから、「http://<host>:<port>/ws_htmlreport.jsp」を実行します。
Code Block |
---|
| /* 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());
}
%> |
|