【转】利用Cognos Audit在Cognos Connection实现用户常用报表的快速导航

浏览: 2681

Cognos导航功能最容易让人诟病,用户多次点击进入不同文件夹才能访问到报表。本方法结合Cognos Audit功能,可以提供按用户划分,按使用率、使用先后时间排序的快速访问接口,将该报表与Cognos Navigater结合嵌入到Page并设置为主页后,相信可以大大提高用户使用Cognos Connection的满意度。

此为为英文文档,等我翻译完成后再附上中文实现方法。

A “My reports” report
By Johannes Melkeraaen, Elkjøp Nordic AS and Pål Rune Stenersen, RAV Norge AS


Over time we have made a lot of reports in our Cognos Connection and these are organised in nine top level
folders: 1. Sales, 2. Stock, 3. Buying etc … The typical user navigates in these folders to find their most
useful reports, and their respective role eventually define their reports of choice. A pure role based solution
to organising the reports can be implemented, but is hard to maintain when new reports are introduced and
many users are not easily casted. Instead, we have made a “My Reports” report with two lists: one for the
most frequently run reports and one for the most recently run reports. The report names in the lists are
clickable so that the relevant reports can be run from here.

Clipboard Image.png

The main advantages of this technique are that users after a short period of report acquaintance don’t have
to navigate through the various folders to find their favorite reports.
The following report is built on IBM Cognos BI version 10.1.1 using the Audit package and requires logging
set to the appropriate level in order to generate output. Our Audit database is on Oracle.

Framework Manager – The Audit Framework

1. In Framework Manager, open up the Audit model that came with the sample.

2. Add a new query item in Query Subject COGIPF_RUNREPORT (Database View) called

REPORTPATH%

Clipboard Image.png

3. Add the following Expression Definition to REPORTPATH%:

'http://servername/ibmcognos/cgibin/
cognos.cgi?b_action=cognosViewer&ui.action=run&ui.object=' ||
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
[Audit].[COGIPF_RUNREPORT].[REPORT
PATH],'/','%2f'),'[','%5b'),'@','%40'),'=','%3d'),'
','%20'),']','%5d'),'&','%26'),'''','%27'),'"','%22')

Note: Remember to change the server name in the URL.

4. We were not able to use the search string directly, as some characters broke the URL when used

in the report. So, we had to use the REPLACE function to percent-encode (or URL-encode) these

characters.

Note: This technique was created using an Oracle database. The REPLACE functionality

may be different for other databases.

5. Add a new query item to the Query subject Run Reports

6. Name the column User ID

7. Add the following Expression Definition to User ID

[Audit].[COGIPF_USERLOGON].[USER NAME]

8. Add a new query item to the Query subject Run Reports

9. Name the column Report search path %

10. Add the following Expression Definition to Report search path %

if
([Audit].[COGIPF_RUNREPORT].[REPORT PATH] = '')
then
('Unsaved report')
else
( [Audit].[COGIPF_RUNREPORT].[REPORTPATH%] )

Report Studio – Building the report

1. Open a new report in Report Studio.

2. Add a list to the report.

3. Rename Query1 to qryMainUsage

4. Add the following data items to the new list attached to qryMainUsage query:

[Audit].[Run Reports].[Report name]
[Audit].[Run Reports].[Report search path %]

5. Create the following report expression

Name: Count

Expression: count([Audit].[Run Reports].[Report search path])

Name : Rank

Expression: Rank([Count])

6. Add these filters to the qryMainUsage query:

 [Audit].[Run Reports].[User name] = #sq($account.personalInfo.userName)# - (filter
on the logged in user)

• [Report name] not in ('adHocReport','Unsaved report','Audit Report Usage','My
Reports')
 - (the reports you want to exclude)

• [Rank] <= 10 - (the report only lists the 10 most used reports)

• [Audit].[Run Reports].[Time stamp] >= {sysdate - 90} - (the report only includes
report run the last 90 days)

Note: SYSDATE might not work depending on your database. Please choose a suitable alternative.

7. Add another list to the report.

8. Rename Query1 to qryMainRecent.

9. Add the following data items to the new list attached to qryMainRecent query :

[Audit].[Run Reports].[Report name]
[Audit].[Run Reports].[Report search path %]

10. Create the following report expression:

Name: Time Stamp

Expression: maximum ([Audit].[Run Reports].[Time stamp] for [Report
search path %])

Name: Rank

Expression: Rank([Time stamp])

11. Add these filters:

• [Audit].[Run Reports].[User Name] = #sq($account.personalInfo.userName)#
• [Report name] not in ('adHocReport','Unsaved report','Audit Report Usage','My
Reports')
• [Rank] <= 10

12. Go back to the first list and add an HTML item as a column:

Clipboard Image.png

13. Change the HTML item source type from text to Report Expression.

14. The expression of the HTML item is:

'<a href='https://ask.hellobi.com/ + '"'+ [qryMainUsage-query].[Report search path %] +
'&run.outputFormat=&run.prompt=true' + '"' + 'target="mainFrame">' +
[qryMainUsage-query].[Report name] + ''

15. Add an HTML item to the second list

Clipboard Image.png

16. Change the HTML item source type from text to Report Expression.

17. The expression of the HTML item is:

'<a href='https://ask.hellobi.com/ + '"'+ [qryMainRecent-query].[Report search path %] +
'&run.outputFormat=&run.prompt=true' + '"' + 'target="mainFrame">' + [qryMainRecentquery].[
Report name] + ''

18. Run the report and make sure it gives output for the session user.

19. Make this report available in a Cognos Viewer portlet which is put in the upper left corner of

Cognos Connection.

If the user has not run any reports, the report will of course not show any data. Then, we can encourage

the user to get more acquainted with the top level folders with a message in the “No Data Contents” of

one of the lists.

推荐 1
本文由 hupingzhi 创作,采用 知识共享署名-相同方式共享 3.0 中国大陆许可协议 进行许可。
转载、引用前需联系作者,并署名作者且注明文章出处。
本站文章版权归原作者及原出处所有 。内容为作者个人观点, 并不代表本站赞同其观点和对其真实性负责。本站是一个个人学习交流的平台,并不用于任何商业目的,如果有任何问题,请及时联系我们,我们将根据著作权人的要求,立即更正或者删除有关内容。本站拥有对此声明的最终解释权。

0 个评论

要回复文章请先登录注册