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