ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old December 7th, 2004, 06:25 PM
izah_2 izah_2 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 34 izah_2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 2 m 48 sec
Reputation Power: 4
limit row display in a page

hi...i got problem when i want to list out only 3 output form in a page..there occur a problem saying that recordcount is undefined in q_print .....
here is my source code..



<body onbeforeprint="printSetup()" onafterprint="printSetup()" onload="javascript:{if(parent.frames[0]&&parent.frames['frmTop'].Go)parent.frames['frmTop'].Go()}">



<!--- <CFPARAM name="MaxRows" default="3">
<CFPARAM name="StartRow" default="1"> --->
<CFPARAM NAME="MaxRows" DEFAULT="3">
<CFPARAM NAME="StartRow" DEFAULT="1">


<cfif isdefined ("form.tick")>
<CFQUERY NAME="q_Print" DATASOURCE="#REQUEST.DSN#">
SELECT *
FROM EDMS_CEOCP
WHERE CEOCP_RECNO IN (#PreserveSingleQuotes(form.tick)#)
</CFQUERY>




<cfoutput><input name="listRecord" type="Hidden" value="#PreserveSingleQuotes(form.tick)#">

</cfoutput><cfoutput query="q_Print" StartRow="#StartRow#" MAXROWS="#MaxRows#">
<table width="34%" border="0" align="center" cellpadding="0" cellspacing="0">


<tr>
<td height="33"><font face="Times New Roman" size="5" align ="center">#CEOCP_TITLE# #CEOCP_NAME#</font></td>
</tr>
<tr>
<td height="33"><font face="Times New Roman" size="5" align ="center">#CEOCP_DESIGNATION# OF #CEOCP_ORGANIZATION#</font></td>
</tr>
<tr>
<td height="33"><font face="Times New Roman" size="5" align ="center">#CEOCP_OADD1#</font></td>
</tr>
<tr>
<td height="33"><font face="Times New Roman" size="5" align ="center">#CEOCP_OADD2#</font></td>
</tr>
<tr>
<td height="33"><font face="Times New Roman" size="5" align ="center">#CEOCP_OADD3#</font></td>
</tr>
</table>
<!-- now if you want each user to print in a different
page then you would add this here, (else leave it out!) --->
<p STYLE="page-break-before: always"></p>

<div align="right"></div>

</cfoutput>

<TR>
<TD colspan=4>
<CFIF (StartRow + MaxRows) LTE q_Print.RecordCount>
<a href="ListPrint_action.cfm?startrow=<CFOUTPUT>#Evaluate(StartRow +
MaxRows)#</CFOUTPUT>">See next <CFOUTPUT>#MaxRows#</CFOUTPUT>
rows</A>
</CFIF>

</TD>
</TR>

</cfif>


<cfform method ="post" name="Printform" action="Print_action.cfm" onsubmit="return IndexCheck()" enctype="multipart/form-data">
<h2 id="noprint">
<table width="680" height="40" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="19" valign="middle" bgcolor="#003366">
<div align="center"><font color="#FFFF33" size ="3"><strong>Print</strong></font></div></td>
</tr>
<tr>
<td height="20" valign="middle" bgcolor="#E2FCFC"> <br>

<div align="center">
<input style="{color=yellow; background-color:#176797}" type="button" name="Print" value="<Print>" onClick="print()">
<input style="{color=yellow; background-color:#176797}" type="button" value="<Print Preview>" onclick="printpr();">
<input style="{color=yellow; background-color:#176797}" type="button" value="<Return>" ONCLICK="history.go(-1)" >

</p>
</div> </div></h2> </td>
</tr>
</table> </cfform>
</body>
</html>

Reply With Quote
  #2  
Old December 7th, 2004, 07:24 PM
izah_2 izah_2 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 34 izah_2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 2 m 48 sec
Reputation Power: 4
i hope u can solve it to me...thanx so much..

Reply With Quote
  #3  
Old December 7th, 2004, 09:26 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,611 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 9 h 10 m 21 sec
Reputation Power: 53
Well, is the query running? I'm guessing it is not, which means the problem is in this line:

<cfif isdefined ("form.tick")>

What you need to do is be sure that the query is running because otherwise, obviously, the query's recordcount value won't exist either.

As an aside, in the future when you want help, please do not simply post a massive script with all this unrelated stuff in it. Eliminate all the extraneous code and narrow the code down to just the code with the problem. First, you'll find that very often you can solve the problem yourself when you simplify it. And second, even if you can't solve it, it makes it a lot easier for others to try and help. Thanks.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #4  
Old December 8th, 2004, 09:53 AM
VelvettFogg VelvettFogg is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 34 VelvettFogg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 13 m 46 sec
Reputation Power: 4
><cfoutput query="q_Print" StartRow="#StartRow#" MAXROWS="#MaxRows#">


Im not comfortable with using #StartRow# and #MaxRows# .. seems to me that is on the verge of using reserved words.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > limit row display in a page


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway