Restricted rows display to the report page which should divisible by 5

Hi Techies,
Need your help for achieving this requirement.
We have got a requirement to display a report in a page which should display max 20 rows but if a report is having totally 17 rows then in the 1st page it has to display 15 rows(divisible by 5) and the other two rows should appear in the next page. Similarly, If a report is having 23 records then in the first page it should display 20 (divisible by 5) and on other page it should display 3 rows.
Please advice!

Questions by shah_nawazzz

Showing Answers 1 - 0 of 0 Answers

Ashish Sharma

  • Apr 17th, 2012

Instead of doing this at cognos level, try to do it at SQL level using rownum function. Take the max of mod(rownum,5). then save the rownum value in a ?variable? and then take all the records where rownum>? Variable?

  Was this answer useful?  Yes


  • Jun 14th, 2012

1.Drag a list report
2.Add the query items you need for the list report
3.Add a Query Calculation to the list report and name it as Running total,In the Expression Definition Type in
running-count([Query Item])
4. Add a Query Calculation to the list report and name it as Rows Display,In the Expression definition type in
floor([Running total]/17)
5. Go to the page Explorer and drag the page set to the page are
6. Change the Query of the page set to your list query
7. In the properties of the page set,click on the ellipses of sort and grouping
8.Drag the Row Display data item under grouping
9.Save and run the report.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions