Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 16th, 2003, 08:36 AM
Authorized User
 
Join Date: Nov 2003
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default page break

Hi,
Ive created a table that groups together records into a particular order. For printing purposes is it possible to force the system to print each "group" on a seperate sheet of paper, even though it will appear as one list on the screen. Is it is possible can some one tell me how?

many thanks

 
Old December 16th, 2003, 08:42 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jonax
Default

Yup, have a look here:
http://p2p.wrox.com/topic.asp?TOPIC_ID=7160

 
Old December 16th, 2003, 10:36 AM
Authorized User
 
Join Date: Nov 2003
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ive tried this, it creates the break after each record. The record are displayed in this format

number name type
1 fred electrical
2 bob electrical
3 ted mechanical
4 geaorge mecahnical
5 ste mechanical

each time the type changes i need this prinitng on a seprate page. Is this possible, or do i have to group the records in a different way on the screen/ within asp

 
Old December 16th, 2003, 11:29 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jonax
Default

It certainly is possible - show me your code and I'll fix it for you...

 
Old December 16th, 2003, 11:35 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Perhaps you are setting the break after each new "number" which would certainly make it break for every record.

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old December 16th, 2003, 12:17 PM
Authorized User
 
Join Date: Nov 2003
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is the code that displays my results

<p class="centered">Below is a list of faulty machines for week <%= week_no %>.<br />Carry out <a class="report" href="maintenance_report.asp">another search</a>.</p>

    <table border="1"align="center" cellspacing="0" cellpadding="2" bordercolordark="#CCCCCC" bordercolorlight="#FFFFFF" width="600">
      <tr>
        <td align="center"><strong>Date</strong></td>
        <td align="center"><strong>Clock No.</strong></td>
        <td align="center"><strong>Shift</strong></td>
        <td align="center"><strong>Machine</strong></td>
        <td align="center"><strong>Fault Type</strong</td>
        <td align="center"><strong>Fault Description</strong</td>
        <td align="center" width="100"><strong>Comment</strong></td>
      </tr>
    <%
       Do While Not RSlist.EOF
    %>
      <tr>
        <td align="center"><%= Rslist("MaintenanceDate") %></td>
        <td align="center"><span class="help" title="<%= Rslist("Initial") %>. <%= Rslist("Surname") %>"><%= Rslist("ClockNo") %></span></td>
        <td align="center"><%= Rslist("Shift") %></td>
        <td align="center"><%= Rslist("MachineNo") %></td>
        <td align="center"><%= Rslist("FaultType") %></td>
        <td align="center"><%= Rslist("Fault") %></td>
        <td align="left"><%= Rslist("Comments") %></td>
      </tr>
      <%
          RSlist.Movenext
        Loop

        Rslist.close
      %>
    </table>
thanks

 
Old December 16th, 2003, 12:17 PM
Authorized User
 
Join Date: Nov 2003
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

forgot to add, ive taken the page break out of this code, so its back to how it began. any help is greatly appreciated

 
Old December 16th, 2003, 12:26 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jonax
Default

Code:
<%
dim sLastType
%>
<p class="centered">Below is a list of faulty machines for week <%= week_no %>.<br />Carry out <a class="report" href="maintenance_report.asp">another search</a>.</p>

    <table border="1"align="center" cellspacing="0" cellpadding="2" bordercolordark="#CCCCCC" bordercolorlight="#FFFFFF" width="600">
      <tr>
        <td align="center"><strong>Date</strong></td>
        <td align="center"><strong>Clock No.</strong></td>
        <td align="center"><strong>Shift</strong></td>
        <td align="center"><strong>Machine</strong></td>
        <td align="center"><strong>Fault Type</strong</td>
        <td align="center"><strong>Fault Description</strong</td>
        <td align="center" width="100"><strong>Comment</strong></td>
      </tr>
    <%
       Do While Not RSlist.EOF
        If sLastType <> "" AND sLastType <> Rslist("FaultType") then
            response.write "<tr style=""page-break-before: always;"">"
            sLastType = Rslist("FaultType")
        Else
            response.write "<tr>"
        End if
    %>
      <tr>
        <td align="center"><%= Rslist("MaintenanceDate") %></td>
        <td align="center"><span class="help" title="<%= Rslist("Initial") %>. <%= Rslist("Surname") %>"><%= Rslist("ClockNo") %></span></td>
        <td align="center"><%= Rslist("Shift") %></td>
        <td align="center"><%= Rslist("MachineNo") %></td>
        <td align="center"><%= Rslist("FaultType") %></td>
        <td align="center"><%= Rslist("Fault") %></td>
        <td align="left"><%= Rslist("Comments") %></td>
      </tr> 
      <%
          RSlist.Movenext
        Loop

        Rslist.close
      %>
    </table>
 
Old December 16th, 2003, 12:28 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jonax
Default

BTW: I'm assuming your results are sorted by the Fault Type...

 
Old December 16th, 2003, 12:37 PM
Authorized User
 
Join Date: Nov 2003
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes, thats great, thankyou for all your help,






Similar Threads
Thread Thread Starter Forum Replies Last Post
Page break grstad Classic ASP Basics 5 December 31st, 2006 01:27 PM
Page Break Neal Crystal Reports 1 August 31st, 2006 10:33 AM
Page Break Dhawood ASP.NET 2.0 Basics 0 August 8th, 2006 08:02 AM
Page Break chakravarthy_vr Reporting Services 1 June 22nd, 2006 10:16 AM
Page Break aspadda Excel VBA 0 February 9th, 2004 02:36 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.