cancel
Showing results for 
Search instead for 
Did you mean: 

export the same webi report several times with different prompt values using java report engine sdk

Former Member
0 Kudos

Hello,

I just started using the Java Report Engine SDK for exporting Webi-Reports on BI4.x.

What I want to achieve is the following workflow:

Connect to the server, open a webi-document and export report-sets as pdfs.

Imagine a report that contains "sales revenue" for different "cities" in different "states" in several "years".

What actually works very fine for me is to get the full report with the entire dataset or to select for example some special cities or years using the setPrompts()-method.

But what I really want is to get a set of pdfs with for example all combinations of states and years (4 states, 3 years --> 12 pdfs).

I actually tested my code with to nested loops with the following code:


for .... {

     for ... {

          doc.refresh();

          ....

          doc.setPrompts();

          save(doc,filename);

     }

}

Now the thing is, that I was wondering if this is the right way to call the refresh()-method every time or if there is a more simple way.

I suppose there is some sort of caching when the refresh-method is called for example severeal thousand times in a row?

By the way, I don't need the prompts if there is another way for filtering the data.

thanks for any advice.

best regards,

peter

Accepted Solutions (1)

Accepted Solutions (1)

DellSC
Active Contributor
0 Kudos

First off, you need to call .refresh() AFTER setting the prompts - otherwise it won't have the correct prompt values before your export.

Another way to do this might be to put the report into a Publication, which can burst it for you.  You'll need to create a second report that will pull the information about where to burst the report into separate files.  This can then be scheduled directly in BO and doesn't need to have any code written.

-Dell

Former Member
0 Kudos

Thanks for the advice concerning the publications, I will have a look on that.

By the way, I tried the refresh() both after and before setting the prompts. At least in my test, that doesn't make any differences.

Former Member
0 Kudos

Hi Peter,

The refresh method just refreshes the document. During a refresh all data providers are refreshed, this mean that the query is executed and the data is fetched from the micro cube. During the query execution, any prompts and contexts in the document are raised.

Calling the refresh method before or after setting the prompts makes difference if in BI InfoView for the report prompts you have turned on option "Keep last values selected". If this option is on and you call refresh method after setting the prompts, it keeps the last value. If this option is off and you call refresh after setting the prompts, the prompts values will be gone and you will not have exact values.

Regarding the publications, you can go through the below links:

http://wiki.scn.sap.com/wiki/display/BOBJ/Personalization+in+SAP+Business+Intelligence+4.0+Web+Intel...

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/8077811e-7637-2e10-7c9f-dcb81d630...

Hope this helps.

Regards,
Rajarsh

Answers (0)