|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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> |
|
#2
|
|||
|
|||
|
i hope u can solve it to me...thanx so much..
|
|
#3
|
|||
|
|||
|
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 |
|
#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. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > limit row display in a page |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|