grpc 双向调用
In a previous article I wrote about how you can invoke an Oracle BI Report using ExternalReportWSSService Web Service. You may read it here.
在上一篇文章中,我写了关于如何使用ExternalReportWSSService Web Service调用Oracle BI Report的信息。 您可以在这里阅读。
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.
在本文中,我有一个带有单个参数的BI报表示例。 我有一个读者提出的非常有趣的问题,询问如果有多个报告参数,我们如何传递参数值。 就是这样
先决条件 (Prerequisites)
Access to Oracle BI Server
访问Oracle BI Server
- Create a BI Report Data Model (xdm) and Report (xdo) 创建BI报表数据模型(xdm)和报表(xdo)
Create a PowerShell script to invoke the ExternalReportWSSService web service
创建一个PowerShell脚本以调用ExternalReportWSSService Web服务
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:
各种方案之间的唯一区别是有效负载文件的内容。 因此,我将针对以下3种情况解释XML Pay Load文件中的差异:
- BI Report with Single Parameter 单参数BI报表
- BI Report with Multiple Parameters (each parameter accepting single values) 具有多个参数的BI报表(每个参数接受单个值)
- BI Report with Multiple Parameters (one or more parameters accepting multiple parameter values) 具有多个参数的BI报表(一个或多个参数接受多个参数值)
单参数BI报表 (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:
假设我们有一个简单的报告,其中列出了给定年份的总帐期间。 该报告的参数P_YEAR可以接受一个值,如2019。该参数的有效载荷如下:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:pub="http://xmlns.oracle.com/oxp/service/PublicReportService">
<soap:Header/>
<soap:Body>
<pub:runReport>
<pub:reportRequest>
<pub:parameterNameValues>
<pub:item>
<pub:name>P_YEAR</pub:name>
<pub:values>
<pub:item>2019</pub:item>
</pub:values>
</pub:item>
</pub:parameterNameValues>
<pub:reportAbsolutePath>/Custom/GL/GL Periods Report.xdo</pub:reportAbsolutePath>
<pub:sizeOfDataChunkDownload>-1</pub:sizeOfDataChunkDownload>
</pub:reportRequest>
</pub:runReport>
</soap:Body>
</soap:Envelope>
On line 8, we specify the parameter name and on line 10 we specify the parameter value.
在第8行,我们指定参数名称,在第10行,我们指定参数值。
具有多个参数的BI报表接受单个值 (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
假设我们修改了列出总帐期间的报告,以接受年份和设定为参数的期间。 该报告有两个参数
- P_YEAR that accepts one value, like 2019 接受一个值的P_YEAR,例如2019
- P_SET that accepts one value, like “US Ledger Set” 接受一个值的P_SET,例如“美国分类帐集”
The payload for the same will be as below:
相同的有效载荷如下:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:pub="http://xmlns.oracle.com/oxp/service/PublicReportService">
<soap:Header/>
<soap:Body>
<pub:runReport>
<pub:reportRequest>
<pub:parameterNameValues>
<pub:item>
<pub:name>P_YEAR</pub:name>
<pub:values>
<pub:item>2019</pub:item>
</pub:values>
</pub:item>
<pub:item>
<pub:name>P_SET</pub:name>
<pub:values>
<pub:item>US Ledger Set</pub:item>
</pub:values>
</pub:item>
</pub:parameterNameValues>
<pub:reportAbsolutePath>/Custom/GL/GL Periods Report.xdo</pub:reportAbsolutePath>
<pub:sizeOfDataChunkDownload>-1</pub:sizeOfDataChunkDownload>
</pub:reportRequest>
</pub:runReport>
</soap:Body>
</soap:Envelope>
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.
让我们关注第7至18行。对于每个参数,以下部分将在XML标签<pub:parameterNameValues>和</ pub:parameterNameValues>中重复。
<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.
在我们的示例中,我们在第8行定义了P_YEAR参数,在第10行定义了值2019相对于P_YEAR参数。在第14行,我们在第16行有了参数P_SET和对应的值“ US Ledger Set”。
具有多个参数的BI报表接受多个值 (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
假设我们修改了列出总帐期间的报告,以接受年份和设定为参数的期间。 该报告有两个参数
P_YEAR that accepts more than one value (the user can select multiple years and report will show data for the years selected)
P_YEAR 接受多个值 (用户可以选择多个年份,并且报告将显示所选年份的数据)
- P_SET that accepts one value, like “US Ledger Set” 接受一个值的P_SET,例如“美国分类帐集”
The payload for the same will be as below:
相同的有效载荷如下:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:pub="http://xmlns.oracle.com/oxp/service/PublicReportService">
<soap:Header/>
<soap:Body>
<pub:runReport>
<pub:reportRequest>
<pub:parameterNameValues>
<pub:item>
<pub:name>P_YEAR</pub:name>
<pub:values>
<pub:item>2019</pub:item>
<pub:item>2020</pub:item>
</pub:values>
</pub:item>
<pub:item>
<pub:name>P_SET</pub:name>
<pub:values>
<pub:item>US Ledger Set</pub:item>
</pub:values>
</pub:item>
</pub:parameterNameValues>
<pub:reportAbsolutePath>/Custom/GL/GL Periods Report.xdo</pub:reportAbsolutePath>
<pub:sizeOfDataChunkDownload>-1</pub:sizeOfDataChunkDownload>
</pub:reportRequest>
</pub:runReport>
</soap:Body>
</soap:Envelope>
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.
让我们关注第7至19行。该部分看起来与前面的示例大致相同。 唯一的区别是第11行 。 如果要为一个参数传递多个值,将在<pub:values>和</ pub:values> XML标记的特定参数中重复以下部分。
<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.
在我们的示例中,我们在第8行定义了P_YEAR参数,在第10和11行定义了参数值2019和2020。 在第15行上,我们在第17行上具有参数P_SET和对应的值“ US Ledger Set”。
结论 (Conclusion)
As you can see it is pretty easy to modify the XML Payload to suit your needs.
如您所见,修改XML有效负载以满足您的需求非常容易。
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.
希望这对你们中的某些人有所帮助。 让我知道您的评论和反馈。 随时从我的g ithub帐户下载PowerShell脚本。
grpc 双向调用
本文详细介绍了如何使用Web服务调用具有不同参数类型的Oracle BI报告,包括单参数、多参数以及接受多个值的参数。通过修改XML有效载荷,可以轻松适应各种场景。

1949

被折叠的 条评论
为什么被折叠?



