Which Method to run Report?

You can use a runReport() or runReportInSession() method to have BI Publisher Enterprise server to run a report and get the report output. The report output will be returned in binary format so you need to take care of handling the binary format appropriately in order to display or locate the report output.

How to Call runReportInSession()?

First of all you need to create a ReportRequest object, with which you can set a report that you want to run. You can also set a report layout template name, report output format type such as ‘pdf, ‘html’, etc, and locale (language and territory) information. Once the ReportRequest is set then you can pass it to the runReportInSession() method along with the session token. The runReportInSession() willl return a ReportResponse object, which contains the report output in a binary format along with the report meta-data information such as content type, language information.

Here is a visualized process flow of the runReport() method.

So basically there are three steps.

Create ReportRequest object

Call runReportInSession() method

Get a report from ReportResponse object

Create ReportRequest Object

You can set the following information when you create the ReportRequest object

Absolute Path to the Report

Report output format

Locale (Language and Country/Territory)

Template name

Function

Method

Description

Output format

void setAttributeFormat()

You can set a desired report output format such as ‘pdf’, ‘rtf’, ‘excel’, etc.

Locale

void setAttributeLocale()

You can set a user’s preferred report locale such as ‘en-US’ for English/America, ‘fr-FR’ for French/France. Based on this setting BI Publisher Enterprise will decide which language translation to use for the specified template if available.

Template Names

void setAttributeTemplate()

You can set a desired template among available templates that are registered for the specified report.

Get a Reprot from ReportResponse Object

Here is a list of the methods that you can use to retrieve information from the ReportResponse object. And the most you care would be the getReprotBytes(), which returns a report output in a binary format.

Function

Method

Description

Report Content

byte[] getReportBytes()

You can get the report content itself. It returns the report in a form of binary so you need to take care of a proper encoding to retrieve the data and handle it appropriately.

Report Content Type

String getReportContentType()

You can get the report’s content type. For example if the report output is generated in a PDF format then it will return ‘application/pdf’.

Troubleshoot

You might not get any report content from the ReportResponse object. If that’s the case you want to add the following code to set a data chunk size to ‘-1’. I had to set this before in order to get the report output successfully, but now it’s working fine without the setting with my latest BI Publisher Server environment. (March ‘10 patchset).

Conclusion

Now you know how to call BI Publisher Web Service to run a report. My example is trying to get the report output and display it in a browser, but of course you can display it as part of your application UI or locate it on a file system.

Anybody can send me an example of a webservice defined as source data in BI Pub ??? I' dont see any example in Internet. I'm using AXIS with Tomcat to host webservices and I can't make a webservice to run in BI Publisher !!!Thanks...

Hi, I've found this tutorial very helpful, it's really nice, but I have a problem, when a test the servlet with IE 8.0.7600 64.bit edition it prompts me a download window, I have to download the file y put it the .pfs extension so I can open the report. When I Test the same servlet with FireFox or Google Chrome it shows the Report with no problem, so my question is: is there a way to see the report in the Internet Explorer without having to donwload the report or there is something wrong in my Servlet??

Hi there!We have trouble with fault processing while running reports using web service API.I beleive soap fault message, returned by BI Publisher, does not conform wsdl definition.This is an example of soap fault message:

Hi Nishida, I'm very new to BIP, I really need your help for following queries1. Is is possible to integrate custom built 2FA Authentication(could be Token-OTP or SMS-OTP) with BIP Login or do we need to develop separate web application and somehow do login to BIP as well(not sure if this could be possible.2. Our application will have some input screens as well. Will it be possible to create screens in BIP.3. Entire UI needs to be custom built.

We are thinking of creating separate Web application and run reports using web services APIs. Can you help to comment if we are moving in right direction or is it possible to do above things in BIP itself