Solved

Recordset counter

Posted on 2011-03-10
2
336 Views
Last Modified: 2013-12-24
When you using recordset paging how do you display on the page the page number out of the total count number and the record number out of the total count.

Example
Page # 5 out of 35
Record 20 out of 765

I would also like to do some thing like this if I could
1..(5)...35
0
Comment
Question by:overcolor
  • 2
2 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 500 total points
Comment Utility
0
 
LVL 52

Assisted Solution

by:_agx_
_agx_ earned 500 total points
Comment Utility
Adding the page numbers is simple. Just use the #perPage# value from the example. If you're showing 10 records per page:

      <cfset perPage    = 10>

The total pages is:
        <cfset totalPages = ceiling(yourQuery.recordCount / perPage)>

The starting record determines the current page number:
       <cfset thisPage   = ceiling(url.start / perPage)>

<cfoutput>
     perPage = #perPage#<br>
     totalPages = #totalPages#<br>
     thisPage = #thisPage#<hr>
</cfoutput>
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now