使用SDK

时间:2016-04-20 09:43:21

标签: java sap business-objects business-objects-sdk

我正在将BI3.X API应用程序迁移到 BI4.1 。该应用程序的目的是从SAP BOE检索PDF报告。

我已经引用了一些文档,并且能够使用Opendoc URL进行创建。但我只接收HTML作为opendoc URL中的响应。所以我决定使用SDK来检索PDF作为回复..

使用SDK登录应用程序时遇到问题。可以从Web浏览器访问BOE群集名称,但我无法对其进行ping操作。

之前我使用带有以下URL的secLDAP身份验证获取了opendoc的令牌 http://server.domain.com:6405/biprws/logon/long

我现在使用的代码:

ISessionMgr sessionMgr = CrystalEnterprise.getSessionMgr();
    IEnterpriseSession enterpriseSession = 
       sessionMgr.logon("username", "password", "server.domain.com:6405", "secEnterprise");
    String sessionToken = enterpriseSession.getLogonTokenMgr().getDefaultToken();

在上面运行代码时,我收到以下错误消息。 无法连接CMS。指定正确的主机和端口并检查网络问题。

我试图看到问题所在。 http://server.domain.com/BOE/BI可以访问 但是当我尝试ping server.domain.com时,它无法访问。

知道我现在该怎么办?我仍然不确定这是如何工作的,因为我是SAP环境的新手。 我甚至不确定我是否应该使用与opendoc一样的服务器名称。

1 个答案:

答案 0 :(得分:0)

您可以使用 opendocument URL 指定格式。只需添加参数sOutputFormat即可。可能的值有:

  • H:HTML
  • P:PDF
  • E:Excel(仅限Crystal Reports)
  • W:RTF(仅限Crystal Reports)

所以你将拥有以下网址: http://server:port/BOE/OpenDocument/opendoc/openDocument.jsp?iDocID=AZuIwjRPI2BApS7VCZMFpNs&sIDType=CUID& sOutputFormat = P

如果你没有cuid,你也可以使用docId http://server:port/BOE/OpenDocument/opendoc/openDocument.jsp?iDocID=5676&sOutputFormat=P

OpenDocument URL文档可在此处获取:https://help.sap.com/businessobject/product_guides/sbo41/en/sbo41_opendocument_en.pdf

要使用REST API 导出PDF格式的rep文件,您必须使用以下URI: HTTP:/// infostore // RPT /出口MIME_TYPE =应用/ PDF

Crystal Reports RESTful文档可在此处找到: http://help.sap.com/businessobject/product_guides/sbo41/en/sbo41sp3_cr_restws_en.pdf