Here is an example how to open Deski report and refresh it and export as PDF using COM SDK.
You will need Visual Studio 2010 Express, BusinessObjects Enterprise XI 3.1 client tools.
1) Create a Deski report (here C:\Users\dmytro\Desktop\Document1.rep)
2) Create a new Project “RunDeski” in VS
3) Add reference to the Deski COM SDK, Project > Add Reference > BusinessObjects 12.0 Object Library
4) Paste the code.
5) Run it.
using busobj; namespace RunDeski { class Program { static void Main(string[] args) { Application application = new Application(); try { application.Interactive = false; application.Logon("Administrator", "", "localhost", "secEnterprise", false, true); IDocument doc = application.Documents.Open(@"C:\Users\dmytro\Desktop\Document1.rep"); doc.Refresh(); doc.ExportAsPDF(@"C:\Users\dmytro\Desktop\Document1.pdf"); doc.SaveAs(@"C:\Users\dmytro\Desktop\Document1.xls"); doc.Close(); } catch (Exception e) { Console.WriteLine(e.ToString()); } finally { application.Quit(); } } } }
Is there a way to retrieve details about tables and charts in deski report using COM SDK?
LikeLike
I assume you can get some information using COM SDK. You can find document “BusinessObjects SDK Object Model Diagrams” on the web, which has class diagrams. Document -> Reports -> Report -> SectionStructure -> ReportStructureItems -> ReportStructureItem. Item has property Type which indicates whether it is cell, table, chart or crosstab; and you can cast the object to BlockStructure and then get Pivot which has properties like rows, columns. (I do not have a code sample for this.)
LikeLike
I tried as you suggested. I could retrieve the Report structure item’s type now and while trying to cast to BlockStructure i get an error, unable to cast object. can u help?
LikeLike
ReportStructureItem can be instance of CellStructure or BlockStructure. So you need to add checking of the instance type.
C#:
VB:
LikeLike
Got it. Thanks a lot..
LikeLike
Is it possible to access webi document using COM SDK? Else which SDK should i be using .NET or JAVA?
LikeLike
There is Report Engine .NET SDK and Report Engine Java SDK http://scn.sap.com/docs/DOC-27446
But NET SDK is very limited.
LikeLike
Can COM SDK busobj be used to open and process a WEBI report?
LikeLike
No. It is only for Deski reports. You will get an error something like: System.Runtime.InteropServices.COMException (0x00000088): Unable to open this document, file is corrupted
LikeLike
Hi,
I am trying to open deski report in server using
IDocument doc = application.Documents.OpenFromEnterprise(“test”,”Deski”,0);
test is my report name, and Deski is the folder name where report exists and its under public folders.
While executing i get error stating ” Document not found on repository”. I could import the same file using my client tool ,so guess there is no problem with my access to server.
Could you please help…
LikeLike
Thanks for the example. We are going to analyse +100.000 Deski reports, before we start the migration to BI4. 🙂
We try to use the file busobj.tlb in Visual Studio but we can not use these files as references. Do we have to treat these files and convert them into .dll’s? Thanks for the feedback.
LikeLike
I believe busobj should be exe file. Don’t you have COM library as described above? Do you have client tools installed on your machine?
LikeLike