cancel
Showing results for 
Search instead for 
Did you mean: 

Parameterized webi report with Rest SDK 4.1 SP1

Former Member
0 Kudos

Is it possible to call a parameterized webi report with "Restful Web Services SDK 4.1" to get html as service response?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI Daniel,

Thanks for replying.

Below code snippiet is working well for non-prompt webi reports.

function exportReportHtml(docId,repId) {

      var x = docId; var y = repId;

      console.log("Getting Report html.");

      $.ajax({url: server + '/biprws/raylight/v1/documents/'+x+'/reports/'+y, type: 'get',

      complete: function(xhr) { parseReportHtml(xhr.responseText); },

      beforeSend: function(xhr) { xhr.setRequestHeader('Accept', 'text/html');      xhr.setRequestHeader('X-SAP-LogonToken', logonToken);

      }

});

}

I am trying to pass prompt(someKey) with value(someValue) as below:

url: server + '/biprws/raylight/v1/documents/'+x+'/reports/'+y?someKey=someValue

Please provide me the documentation link as you mentioned in response above.

Regards, Deepak

daniel_paulsen
Active Contributor
0 Kudos

Hi Deepak,

You won't be able to pass parameters on the URL.  You will have to post them in the body of an HTTP request where your body (if using XML) would look something like:

  <parameters>

    <parameter dpId="DP1" type="prompt" optional="false">

     <id>0</id>

     <technicalName>Enter value(s) for Year</technicalName>

     <answer>

      <values>

        <value>2005</value>

      </values>

      </answer>

    </parameter>

  </parameters>

Then you can call the export function

The RESTful documentation can be found at:

SAP BusinessObjects Business Intelligence platform 4.1 – SAP Help Portal Page

The document is called: SAP BusinessObjects RESTful Web Service SDK User Guide for Web Intelligence and the BI Semantic Layer

Dan

former_member197386
Active Contributor
0 Kudos

Hello Deepak,

Sure, you can do that in a few REST calls:

1. logon

2. get the html ouput of your report

3. logoff

Best regards,

Anthony

Former Member
0 Kudos

Hello Anthony,

Thanks for the quick response, let me rephrase my question.

I am able to get html of only those report which don't have prompts, as a response of Rest call. I need to know the approach to pass prompt value as query string to call Rest service.

Please let me know.

Below is code snippet to call Rest service.

daniel_paulsen
Active Contributor
0 Kudos

Hi Deepak,

use:

GET   .../raylight/v1/documents/<docId>/parameters

to get the template for parameters and then fill in the values and PUT back to the same URL using the filled in template in the body of your post..

after that, you can view as html.

The workflows for different parameter types (context, prompt, hierarchical etc) are described in the documentation under "Refreshing a document"

Dan

Former Member
0 Kudos

HI Daniel,

Thanks for replying.

Below code snippiet is working well for non-prompt webi reports.

function exportReportHtml(docId,repId) {

      var x = docId; var y = repId;

      console.log("Getting Report html.");

      $.ajax({url: server + '/biprws/raylight/v1/documents/'+x+'/reports/'+y, type: 'get',

      complete: function(xhr) { parseReportHtml(xhr.responseText); },

      beforeSend: function(xhr) { xhr.setRequestHeader('Accept', 'text/html');      xhr.setRequestHeader('X-SAP-LogonToken', logonToken);

      }

});

}

I am trying to pass prompt(someKey) with value(someValue) as below:

url: server + '/biprws/raylight/v1/documents/'+x+'/reports/'+y?someKey=someValue

Please provide me the documentation link as you mentioned in response above.

Regards, Deepak