In a previous article I wrote about how you can invoke an Oracle BI Report using ExternalReportWSSService Web Service. You may read it here.

In the article I have an example of a BI Report with a single parameter. I had a very interesting question from a reader asking about how we pass parameter values if there are more than one report parameter. So here it is.

Prerequisites

Access to Oracle BI Server

The only difference between various scenarios is the content of the Pay Load File. So I am going to explain the differences in the XML Pay Load file for the following 3 scenarios:

BI Report with Single Parameter

Lets say we have a simple report that lists the GL Periods for a given year. The report has a parameter P_YEAR that accepts one value like 2019. The payload for the same will be as below:

https://gist.github.com/raj-arun/70d995f567785b697058cd34c71ce01d

On line 8, we specify the parameter name and on line 10 we specify the parameter value.

BI Report with Multiple Parameters Accepting Single Values

Lets say we modified the report that lists the GL Periods to accept the year and the period set as parameters. The report has two parameters

The payload for the same will be as below:

https://gist.github.com/raj-arun/3099cb1025ca6f563525ecc4daf5523e

Let’s focus on Lines 7 through 18. For each parameter you have, the following section will be repeated within <pub:parameterNameValues> and </pub:parameterNameValues> XML tags.

<pub:item>    
    <pub:name>PARAMETER_NAME</pub:name>    
    <pub:values>     
        <pub:item>PARAMETER_VALUE</pub:item>    
    </pub:values>   
</pub:item>

In our example, we have P_YEAR parameter defined on line 8 and the value 2019 against the P_YEAR parameter on line 10. On line 14, we have the parameter P_SET and the corresponding value “US Ledger Set” on line 16.

BI Report with Multiple Parameters Accepting Multiple Values

Lets say we modified the report that lists the GL Periods to accept the year and the period set as parameters. The report has two parameters

The payload for the same will be as below:

https://gist.github.com/raj-arun/83ccdf80762f9ed91fb545a92c6db19d

Let’s focus on Lines 7 through 19. The section looks mostly the same as the previous example. The only difference is line 11. If you are passing multiple values for a parameter, you will have the following section repeated within the <pub:values> and </pub:values> XML tags for the specific parameter.

<pub:values>
    <pub:item>VALUE 1</pub:item>
    <pub:item>VALUE 2</pub:item>          
</pub:values>

In our example, we have P_YEAR parameter defined on line 8 and on lines 10 and 11 we are passing 2019 and 2020 as values for the parameter. On line 15, we have the parameter P_SET and the corresponding value “US Ledger Set” on line 17.

Conclusion

As you can see it is pretty easy to modify the XML Payload to suit your needs.

Let me know if you want me to create video tutorial on this.

Hopefully this helps some of you out there. Let me know your comments and feedback. Feel free to download the PowerShell script from my github account.

Leave a Reply

Your email address will not be published. Required fields are marked *