BO XI中利用URL传参解决关联报表问题
上一篇:推荐一个BusinessObjects论坛 下一篇:今日你饭否?

BO XI中利用URL传参解决关联报表问题

关联报表需求如下:

报表1:

产品    产量
A     100
B     120
C     130

现在需要在产品列上随便点击某个产品,进入到另外一张报表2,得到关于这个产品的一些详细信息,比如

产品  体积  颜色
A   100  RED

BusinessObjects XI中没有Crystal report中的subreport功能,无法直接在图形工具中实现报表的关联。但是,在BOE平台上发布的报表,可以通过URL传参数来解决类似的关联报表问题。

实现方法:

在报表1的产品列上加一个URL(注意将表格中该列的显示格式从默认的Text修改为HTML)。

URL构成如下(以BO XIR2版本为例,其他版本请参考对应的文档):

Java平台:
http://server:port/businessobjects/enterprise115/desktoplaunch/opendoc/openDocument.jsp?parameter=value

.net平台
http://server:port/businessobjects/enterprise115/InfoView/scripts/openDocument.aspx?parameter=value

要实现关联,自然需要指定要关联的报表的位置,文档名,报表名,要传入的参数等一堆东西,这个就要靠parameter=value来实现了,URL中的每对参数值之间用&分隔。

主要的parameter有:

sPath:指定关联报表所在的文件夹,如果有多层,则需要从顶层起一一列出。注意这里的顶层不包括InfoView中Home和Public,比如在Public下有一个ReportTest文件夹下的报表,则sPath=[ReportTest],如果报表在子文件夹Test中,则sPath=[ReportTest],[Test]。

sDocName:指定报表文件的名字,不需要扩展名。比如sDocName=subreport。

sReportName:一个报表文档中可以包含多个report,该参数就是指定具体的report。如sReportName=Report1。

sType:指定报表的类型,如web intelligence报表为sTyep=wid。

有了上面几个参数,就可以定位到一个具体的report了,当然还可以继续定位到这个report的具体某个部分。而且,除了使用sDocName,也可以使用iDocID,但是iDocID获取不如sDocName。

下面是最重要的,就是传递参数比如产品名A给关联报表。要实现参数传递,需要在关联报表中加一个查询过滤器,并且指定为prompt方式,设置prompt的提示信息为ProductName。

传递单个参数的格式为:lsS[Name]=value,如lsSProductName=A
传递多个参数的格式为:lsM[Name]=value,如lsMProductName=[A],[B]
传递范围参数的格式为:lsR[Name]=value…value,如lsRProductName=[A…C)

注意这里的Name区分大小写,并且中间有空格的话请用+代替。

好了,综合前面的所有参数,我们就可以得到从报表1连接到报表2的一个URL了:

http://server:port/businessobjects/enterprise115/desktoplaunch/opendoc/openDocument.jsp?sPath=[ReportTest]&sDocName=subreport&sReportName=Report1&sType=wid&lsSProductName=A&sRefresh=Y&sWindow=New

现在只需要将报表1的产品列的公式修改为下面的形式,就可以实现我们前面提出的需求了:

="<a href=\"http://server:port/businessobjects/enterprise115/desktoplaunch/
opendoc/openDocument.jsp?sPath=[ReportTest]&sDocName=subreport&sReportName=Report1&sType=wid&lsSProductName=
"+[Product Name]+"&sRefresh=Y&sWindow=New\">"+[Product Name]+"</a>"

本文只列举了几个常用的参数,更多参数描述请见官方文档:How to use the openDocument URL command(KBase Article ID:328113)

本文网址:http://www.ningoo.net/html/2007/how_to_use_opendocument_url_command.html

订阅到Google | 收藏到Del.icio.us | 推荐到鲜果

相关文章 随机文章

本文Tags: ,

9 条评论


(Required)
(Required, will not be published)