壹佰网|ERP100 - 企业信息化知识门户

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 357|回复: 0

cognos中如何添加查询总页数?

[复制链接]
发表于 2012/3/17 13:05:46 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622  。

您需要 登录 才可以下载或查看,没有帐号?注册

x
请问下高手,在cognos中如何加查询的总页数,我知道cognos中有报表函数可以显示当前页PageNumber(),现在我想也列出总页数,可是用PageCount()在cognos中显示为"?",不知道哪位高手遇过这样的问题,请高手指点一下

解决方案:

Page numbers appear as question marks in HTML- sample report to work around issue.
  
Technote (troubleshooting)
  
Problem(Abstract)
Clicking on the page down link in an HTML report results in page numbers of the form "1 of ?". In other formats, this issue does not occur. The reason for this is that reports run in HTML format are page on demand meaning that we pull back just enough data to display on the requested page. When the page-down link is clicked, we pull back data for the next page and so forth. Therefore, we do not know the total number of pages in the report.

If the report consists of a list with the left most item grouped and all rows for each element of the grouped item are to appear on a single page, there is a work around to this issue. This document contains a sample report where this is done and steps on how to create this report.  
  
  



Cause
Since HTML reports are page on demand, we do not know the total number of pages in the report on the fly.  
  

Resolving the problem
The assumptions in this document are that we are working with a list report with the left most item grouped and each element in the grouped item is displayed on a single page. We can then perform calculation to count the total number of pages and the page number associated with each element of the grouped item.
Steps:1. Add "Product line", "Product type", "Order method" and "Revenue" to a list. (Query entitled "Main" in the sample attached).
2. Group "Product line".
3. Create a new query (called "PageBreaker" in the sample) and add product line to it.
4. Add a data item called "TotalcountProdline" to query "PageBreaker" and define it as:
count ([gosales_goretailers].[Products].[Product line] for report)
5. Add a data item called "RunningcountProdline" to query "PageBreaker" and define it as:
running-count ([gosales_goretailers].[Products].[Product line])
6. Go the Page Explorer and click on "Report Pages".
7. Add a page set under "Page 1".
8. In the properties for the page set, set the "Query" property to the "PageBreaker" query.
9. Click on the grouping and sorting property for the page set. Add "Product Line" to the "Groups" by dragging it into the folder called "Groups". Click ok.
10. Drag "Page1" into the folder called "Detail pages" under the page set that was created.
11. Go to Page 1 of the report and select the entire list. Go to the "Data" menu and select "Master detail relationships". Create a new link between the two product lines.
12. Select the entire page of the report and associate it to Query "PageBreaker".
13. In the page footer, delete the text item called with definition PageNumber(). Add three text items. Define the first and the third text items to use a report expression and base them on RunningcountProdline and TotalcountProdline. The middle text item can just contain the text "of". Page numbers should now appear as "1 of 5", "2 of 5" etc.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|手机版|壹佰网 ERP100 ( 京ICP备19053597号-2 )

Copyright © 2005-2012 北京海之大网络技术有限责任公司 服务器托管由互联互通
手机:13911575376
网站技术点击发送消息给对方83569622   广告&合作 点击发送消息给对方27675401   点击发送消息给对方634043306   咨询及人才点击发送消息给对方138011526

GMT+8, 2025/11/30 07:42 , Processed in 0.010335 second(s), 14 queries , File On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表