2010-05-12 119 views
0

我們有一個客戶端正在使用SDK在Business Objects Embedded Report Server上調用報告。我們可以登錄,但是當調用openDocument方法時,出現了問題。使用SDK客戶端的Business Objects Enterprise報告給出例外

代碼:

 //LOGON 
IEnterpriseSession session = sessionMgr.logon(username, password, clusterNode,  authType); 
IInfoStore infoStore = (IInfoStore)session.getService("InfoStore"); 

//GET REPORT OBJECT 
String queryForFolder = "Select SI_ID, SI_NAME From CI_INFOOBJECTS Where SI_NAME = '" + folderName + "'"; 
IInfoObjects queryForFolderResult = infoStore.query(queryForFolder); 
if (queryForFolderResult.isEmpty()) 
{ 
    throw new Exception("No Folder Found"); 
} 
//report folder found 
IInfoObject reportFolder = (IInfoObject)queryForFolderResult.get(0); 

String queryForFile = "Select SI_ID, SI_NAME From CI_INFOOBJECTS Where SI_NAME = '" + reportFile + "'" + " and SI_PARENTID = " + reportFolder ; 

IReportAppFactory reportAppFactory = (IReportAppFactory)session.getService("RASReportFactory"); 
IInfoObjects queryForFileResult = infoStore.query(queryForFile); 

if (queryForFileResult.isEmpty()) 
{ 
    throw new Exception("Report file not found"); 
} 
//report found 
IReport report = (IReport)queryForFileResult.get(0); 

//OPEN REPORT 
clientDoc = reportAppFactory.openDocument(report, 0, locale); /*row 58 in exception*/ 

例外:

com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException: Unable to connect to the server: . - Server not found or server may be down---- Error code:-2147217387 Error code name:connectServer 
at com.crystaldecisions.sdk.occa.managedreports.ras.internal.RASReportAppFactory.a(Unknown Source) 
at com.crystaldecisions.sdk.occa.managedreports.ras.internal.RASReportAppFactory.a(Unknown Source) 
at com.crystaldecisions.sdk.occa.managedreports.ras.internal.RASReportAppFactory.a(Unknown Source) 
at com.crystaldecisions.sdk.occa.managedreports.ras.internal.RASReportAppFactory.openDocument(Unknown Source) 
at com.reportclient.MyReportClient.getReportFromInfoStore(MyReportClient.java:58) 
... 28 more 
Caused by: com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException: Unable to connect to the server: . - Server not found or server may be down---- Error code:-2147217387 Error code name:connectServer 
at com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException.throwReportSDKServerException(Unknown Source) 
at com.crystaldecisions.sdk.occa.managedreports.ras.internal.CECORBACommunicationAdapter.connect(Unknown Source) 
... 32 more 
Caused by: com.crystaldecisions.enterprise.ocaframework.OCAFrameworkException$NotFoundInDirectory: Server not found or server may be down 
at com.crystaldecisions.enterprise.ocaframework.j.find(Unknown Source) 
at com.crystaldecisions.enterprise.ocaframework.AbstractServerHandler.buildServerInfo(Unknown Source) 
at com.crystaldecisions.enterprise.ocaframework.AbstractServerHandler.buildClusterInfo(Unknown Source) 
at com.crystaldecisions.enterprise.ocaframework.aa.for(Unknown Source) 
at com.crystaldecisions.enterprise.ocaframework.ServiceMgr.for(Unknown Source) 
at com.crystaldecisions.enterprise.ocaframework.o.a(Unknown Source) 
at com.crystaldecisions.enterprise.ocaframework.o.a(Unknown Source) 
at com.crystaldecisions.enterprise.ocaframework.o.a(Unknown Source) 
at com.crystaldecisions.enterprise.ocaframework.p.a(Unknown Source) 
at com.crystaldecisions.enterprise.ocaframework.ServiceMgr.getManagedService(Unknown Source) 
... 33 more 

登錄時明顯作品的通信,請讓我知道如果你有任何意見或知道在哪裏可以去尋找答案。 :)

問候, 卡爾

+0

reportAppFactory是什麼? – shrub34 2010-05-12 13:59:36

回答

0

我要去猜測,您正在使用的ReportEngine,您的變量reportAppFactory,是不是你正在試圖打開文檔的類型正確。

另一種可能性是這是一個DeskI報告,它正在查找連接服務器組件以便能夠打開文檔。

如果您可以提供更多詳細信息,我會盡力提供幫助。

+0

嗨! 感謝您的回覆。我已經更新了一些更詳細的代碼。我試圖運行一個Crystal.rpt文件。它已被上傳到BO知識庫併發布。 /Karl – 2010-05-14 05:49:05

+0

我最近的更新讓你明智嗎? 讀取報告應該傳輸時溝通改變端口的地方。在所有的API調用中發生了這種情況?然後使用哪個端口? – 2010-05-17 10:10:44

+0

它確實給了我更多的清晰。端口變化應該從系統中抽象出來。只要您的會話正確,系統的其餘部分將自行確定其端口。你所做的一切看起來都是正確的;您是否已驗證Crystal Server(CMC內部)是否正在運行並已啓用,並且您的會話所用的用戶是否可以使用它?我可能已接近我的知識結束,因爲我沒有使用過,也沒有安裝過Crystal。 – shrub34 2010-05-17 13:49:53

1

經過一番進一步的研究,我發現了這一點。第一個錯誤是由BO SDK早期版本的使用引起的。當iiop端口未打開時,出現第二個錯誤「CORBA通信失敗:原因[錯誤編號WSAETIMEDOUT]」。我通過設置SDK偵聽器端口(在文檔http://www.sdn.sap.com/irj/boc/go/portal/prtroot/docs/library/uuid/0047e5f4-3140-2b10-1bae-de175e4c741c?QuickLink=index&overridelayout=true中描述)解決了這個問題,並且三重檢查了是否創建了正確的防火牆。

相關問題