Re: how to separate 400 query resutls into 20 pages?

2000-05-11 Thread Xing Li

Ins,

I would recommend Ben Forta's CF books since he has a very clear section on
how to implement that. In the simplist form, you have something like this:

CFPARAM Name="Url.Page" default="1"
CFPARAM Name="Variables.MaxPerPage" default="50"

CFQUERY Name="myData"

CFLOOP Quey="myData" startRow="#Evaluate(Url.Page * MaxPerPage - MaxPerPage
+ 1)#" endrow="#Evaluate(Url.Page * MaxPerPage)#"



/CFLOOP


All you need to pass in is the incremented page counter (Url.Page) and
calculate the offsets depending on how many records you want per page.

StartRow and EndRow attributes do work and they work rather well. However,
if you have a query that returns something huge, like 10,000 records, I
would suggest caching and segementing the query by caching the page
boundries.

Xing



 Hi,
 
 I have a query which returns 431 results:
 
 cfquery name="qGetCompany"
 select companyname
 from company
 where countrycode='au'
 /cfquery
 
 I want to separate these results into many pages, each
 page contains 20 results and have links to each page,
 if the current result is on page 4 ,should have this :
 
 page1, 2, 3,prev,  4.. next 6, 7 ...20...
 
 startrow  endrow don't work:(resuilts are not from
 continueing row numbers in the table)
 cfloop query="qGetCompany"
 startrow="#starrowthispage#"
 endrow="#endrowthispage#"


--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: how to separate 400 query resutls into 20 pages?

2000-05-11 Thread Russell, Bonnie

There's a tag at allaire called page_thru that works well.  It puts a list
across the top of your page with page links and increments according to what
you set.

Bonnie
Automated Graphics


-Original Message-
From: Xing Li [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 11, 2000 4:07 AM
To: [EMAIL PROTECTED]
Subject: Re: how to separate 400 query resutls into 20 pages?


Ins,

I would recommend Ben Forta's CF books since he has a very clear section on
how to implement that. In the simplist form, you have something like this:

CFPARAM Name="Url.Page" default="1"
CFPARAM Name="Variables.MaxPerPage" default="50"

CFQUERY Name="myData"

CFLOOP Quey="myData" startRow="#Evaluate(Url.Page * MaxPerPage - MaxPerPage
+ 1)#" endrow="#Evaluate(Url.Page * MaxPerPage)#"



/CFLOOP


All you need to pass in is the incremented page counter (Url.Page) and
calculate the offsets depending on how many records you want per page.

StartRow and EndRow attributes do work and they work rather well. However,
if you have a query that returns something huge, like 10,000 records, I
would suggest caching and segementing the query by caching the page
boundries.

Xing



 Hi,
 
 I have a query which returns 431 results:
 
 cfquery name="qGetCompany"
 select companyname
 from company
 where countrycode='au'
 /cfquery
 
 I want to separate these results into many pages, each
 page contains 20 results and have links to each page,
 if the current result is on page 4 ,should have this :
 
 page1, 2, 3,prev,  4.. next 6, 7 ...20...
 
 startrow  endrow don't work:(resuilts are not from
 continueing row numbers in the table)
 cfloop query="qGetCompany"
 startrow="#starrowthispage#"
 endrow="#endrowthispage#"



--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



thanks! RE: how to separate 400 query resutls into 20 pages?

2000-05-11 Thread Ins

Thanks Russell!
I will try it now!
Ins 
Australia


--- "Russell, Bonnie" [EMAIL PROTECTED] wrote: 
There's a tag at allaire called page_thru that works
 well.  It puts a list
 across the top of your page with page links and
 increments according to what
 you set.
 
 Bonnie
 Automated Graphics



_
http://movies.yahoo.com.au - Yahoo! Australia  NZ Movies
- Find out what's on at the local cinema with Yahoo! Movies
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



how to separate 400 query resutls into 20 pages?

2000-05-10 Thread Ins

Hi,

I have a query which returns 431 results:

cfquery name="qGetCompany"
select companyname
from company
where countrycode='au'
/cfquery

I want to separate these results into many pages, each
page contains 20 results and have links to each page,
if the current result is on page 4 ,should have this :

page1, 2, 3,prev,  4.. next 6, 7 ...20...

startrow  endrow don't work:(resuilts are not from
continueing row numbers in the table)
cfloop query="qGetCompany"
startrow="#starrowthispage#"
endrow="#endrowthispage#"


Anyway to do it?
Thank
Ins

_
http://movies.yahoo.com.au - Yahoo! Australia  NZ Movies
- Find out what's on at the local cinema with Yahoo! Movies
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.