Skip to main content
Inspiring
October 11, 2008
Answered

<cfquery> / <cfdocument> / <cfoutput> Dilemma

  • October 11, 2008
  • 1 reply
  • 395 views
Greetings to all,

I have tried to figure this out on my own without
having much luck an am posting here to get a
another set of eyes to review the situation.

I have a query that returns 29 records. I desire
to display the output in the following manner.

Page 1 ( 13 records ) – records 1 thru 13
Page 2 ( 13 records ) – records 14 thru 26
Page 3 ( 03 records ) – records 27 thru 40

Here is what is displaying.

Page 1 ( 13 records ) – records 1 thru 13
Page 2 ( 16 records ) – records 14 thru 29
Page 3 ( 03 records ) – records 27 thru 29

Here is my current code. Perhaps someone in here
can look it over and bring to surface what it is I am
missing and direct me in the right direction to achieve
my desired output.

<cfquery name="qname" datasource="dsname">
SELECT
Count(dept_name) AS dept_count, dept_name
FROM
ncrfa_value_added_leadership
GROUP BY
dept_name
ORDER BY
dept_name ASC
</cfquery>

<cfdocument
format="PDF"
pagetype="letter"
margintop=".50"
marginbottom=".50"
marginright=".50"
marginleft=".50"
orientation="portrait"
unit="in"
backgroundvisible="yes"
overwrite="no"
fontembed="yes">

<cfoutput query="rs_billing" startrow="1" maxrows="13">
#NumberFormat(CurrentRow,00)# #dept_name#<br>
</cfoutput>

<cfdocumentitem type="pagebreak" />

<cfoutput query="rs_billing" startrow="14" maxrows="26">
#NumberFormat(CurrentRow,00)# #dept_name#<br>
</cfoutput>

<cfdocumentitem type="pagebreak" />

<cfoutput query="rs_billing" startrow="27" maxrows="40">
#NumberFormat(CurrentRow,00)# #dept_name#<br>
</cfoutput>

</cfdocument>

Thanks in advance for assistance

Leonard
    This topic has been closed for replies.
    Correct answer
    Your maxrows are set incorrectly... if you keep them all at 13 it would work the way you wanted.

    1 reply

    Correct answer
    October 11, 2008
    Your maxrows are set incorrectly... if you keep them all at 13 it would work the way you wanted.
    Leonard_BAuthor
    Inspiring
    October 11, 2008
    Hi eightcharacters,

    Well crap and a head slap. Thanks for the second set of eyes.
    I was just focusing too hard on the thing and obviously thinking
    a different path.

    Again appreciate the second set of eyes on the situation.

    Leonard