30日間の無料評価版をお試しいただけます。

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 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」に設定します。

ReportRequestStringwebサービス関数です。「HTML」、「HTMLCHARTONLY」、または「HTMLTABLEONLY」に設定します。
ReportIdIntegerHTML形式で返すレポートを特定するための内部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オブジェクトの配列です。

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の例に基づき、以下の応答を返します。

<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サービスを初期化します。実行方法の詳細は、こちらを参照してください。

 

  • 返される応答には、レポートに関連するパラメーターが含まれます。(より詳細な情報は、上記応答パラメーターの表を参照してください)

 

完成例

以下は、こちらの関数の完成例です。こちらを使用するには、以下の手順に従います。

  1. コードをコピーして、「ws_htmlreport.jsp」として保存します。
  2. root(Yellowfin/appserver/webapps/ROOT)フォルダーにファイルを配置します。
  3. 環境に応じて、ホスト、ポート番号、管理ユーザーの詳細を調整します。
  4. インターネットブラウザから、「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());
    }
%>

こちらの関数は、指定したレポートをXLS、またはXLSX形式(エクセルスプレッドシート)で返します。

 

リクエスト要素

以下の要素は、こちらのリクエストとともに渡されます。

リクエスト要素データ型説明

LoginId

String

Yellowfin Webサービスの管理者ユーザーIDです。これは、ログインIDの方法に応じて、ユーザーID、または電子メールアドレスになります。

このYellowfinアカウントは、「Yellowfin Webサービス使用権」が有効化されたロールを持ち、デフォルト(プライマリー)組織に所属していなくてはいけません。

Password

String

上記アカウントのパスワードです。

OrgId

Integer

Yellowfin内のデフォルト(プライマリー)組織IDです。常に、「1」に設定します。

ReportRequestStringwebサービス関数です。「XLSX」、または「XLS」に設定します。
ReportIdIntegerXLSX/XLS形式で返すレポートを特定するための内部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>XLSX</reportRequest>
            <reportId>56401</reportId>
         </arg0>
      </web:remoteReportCall>
   </soapenv:Body>
</soapenv:Envelope>

 

応答要素

応答には、これらの主要なパラメーターが含まれます。

応答要素データ型説明
StatusCodeString

webサービスのステータスです。選択肢は、以下の通りです。

  • SUCCESS
  • FAILURE

ReportId

Integer

指定したレポートのIDです。

ReportName

String

指定したレポートの名前です。

HitCount

Integer

指定したレポートがアクセスされた回数です。

FormatCode

String

指定されたレポートの書式コードです。

BinaryData

String

Base64でエンコードされたXLSX、またはXLSのバイナリーチャンクです。

ContentType

String

このオブジェクトのMIMEコンテンツタイプです。値は「application/vnd.openxmlformats-officedocument.spreadsheetml.sheet」になります。

 

応答の例

サービスは、今回の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>UEsDBBQACAgIAJUKa0wAAAAAAAAAAAAAAAALAAAAX3JlbHMvLnJlb ...</binaryData>
            <canDrill>false</canDrill>
            <category>Audit Reports</category>
            <contentType>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</contentType>
            <dashboardEnabled>true</dashboardEnabled>
            <dataOutput>COLUMN</dataOutput>
            <datasource>Yellowfin Configuration Database</datasource>
            <errorCode>0</errorCode>
            <formatCode>REPORTANDCHART</formatCode>
            <hitCount>25</hitCount>
            <lastModifiedDate>2016-03-29</lastModifiedDate>
            <lastRunDuration>0</lastRunDuration>
            <lastRunStatus>RUN_NOERROR</lastRunStatus>
            <messages>Successfully Authenticated User: admin@yellowfin.com.au</messages>
            <messages>Loaded Report: 56401 Successfully</messages>
            <messages>Generating XLS Report</messages>
            <messages>Request Contains No ReportFilter Records.</messages>
            <messages>Report Run Successfully</messages>
            <messages>Web Service Request Complete</messages>
            <preRunFilterString><![CDATA[<div class="rptFilterLogicText">
<span class="rptFilterLogicIdentifier">Active Session Start</span>
Is Not Null
<span class="rptFilterLogicIdentifier"></span>
</div>]]></preRunFilterString>
            <private>false</private>
            <reportDescription/>
            <reportId>56401</reportId>
            <reportName>Active Sessions</reportName>
            <reportTemplate>REPORTANDCHART</reportTemplate>
            <reportUUID>594d4da4-1b58-44d3-bf4f-11456a42f68c</reportUUID>
            <reportUsage>26</reportUsage>
            <sessionId>18097e8275689f88876f004a07935a7c</sessionId>
            <statusCode>SUCCESS</statusCode>
            <subCategory>Admin Reports</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("XLSX");
  • レポートの保存されているクライアント組織を指定する必要がある場合は、こちらのコードを追加します。

     

    rsr.setOrgRef("org1");      // search for the report in this client org
  • XLSX書式に変換するレポートを指定します。

     

    rsr.setReportId(60712);
  • リクエストを構成したら、呼び出しを実行します。

    ReportServiceResponse rs=rsc.remoteReportCall(rsr);

    レポートwebサービスを初期化します。実行方法の詳細は、こちらを参照してください。

 

  • 返される応答には、StatusCode、ReportID、BinaryDataなどのパラメーターが含まれます。(より詳細な情報は、上記応答パラメーターの表を参照してください)

 

完成例

以下は、こちらの関数の完成例です。こちらを使用するには、以下の手順に従います。

  1. コードをコピーして、「ws_xlsxreport.jsp」として保存します。
  2. root(Yellowfin/appserver/webapps/ROOT)フォルダーにファイルを配置します。
  3. 環境に応じて、ホスト、ポート番号、管理ユーザーの詳細を調整します。
  4. インターネットブラウザから、「http://<host>:<port>/ws_xlsxreport.jsp」を実行します。

/*              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());
    }
%>

 

 

 

 


  • No labels