PDA

View Full Version : Printing Page-Break


ghornet
03-01-2003, 12:15 AM
Hi I am running a report off of my internal web page we run IE 5.5 and I am trying to run through a loop to spit out all of my information, this works just fine, I use page-break-before and the end of each loop so that each piece of information should be on a different page. The information comes out ok, but when I go to file->print it will try to print out 200+ pages.. at like 1.41MB. There should only be 14 pages or so being printing out.. here is the first piece that I want printed out, the rest looks the sames I took out most of the middle because it is just extranious td's. Any help would be great


<HTML>
<meta NAME="GENERATOR" Content="Microsoft FrontPage 4.0">
<LINK rel="stylesheet" type="text/css" href="../css/normal.css">

<SCRIPT language = "Javascript">

</script>
<Style>
<!--
#instructions
{
position:absolute;
top:5px;
left:300px;
height:65px;
width:420px;
background-color: #ffffff;
border: 1px solid;
font-size: 10px;
margin: 3px;
}
p.page
{
page-break-after: Always
}
-->
</style>
<title>South Hill Mall</title>
<head>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--





//-->
</SCRIPT>
</head>
<body>

Loop starts here

<center><h3>2/21/2003 South Hill Mall</center></h3>


<table border="1" cellspacing="1" width="100%" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellpadding="0" height="34">
<tr>
<td width=10% class=Label height=10 align=right>Date</td>

<td width=10% class=Label height=10 align=right>Pending</td>
<td width=16% bgcolor=#FFFFFF height=10><select name="Pending" id="Pending"><option value="no">no
<option value="no">no
<option value="yes">yes</select>
</td>
</tr>
<tr>

<td> </td>
</tr>
</table>
<table>
<tr>
<td align=center class=filled></td>
</tr>
</table>
<p class=page>


then the loop starts over

nickoli21
03-01-2003, 12:27 AM
I don't see why your code would run on the printer for so long, but I'm sure I'm missing something. You might try putting a window.print() statement at the bottom of the page and see if that makes a difference. It shouldn't, but you never know.

<input type="button" id="print1" value="Print Page" onclick="window.print()" />

Nick

justame
03-01-2003, 01:59 AM
gho...
oneee thing /me just a sees® is that youve got some script/style/meta/link/title tags just a before® your opening <head> tag...
n' in your first just a table®??? your first tr has just a three® td's...n' your next tr has just a one® td...:O(((

those coulddd be just a part® of your prob...
just a guessin'® 'cept ya nevvver know...:O))) goodluck

Nightfire
03-01-2003, 02:11 AM
And also get this right

<center><h3>2/21/2003 South Hill Mall</center></h3>

It should be

<center><h3>2/21/2003 South Hill Mall</h3></center>

ghornet
03-03-2003, 08:44 PM
Still does'nt work.. any more ideas.. the reason the td's are off is cause I cut out a bunch of the middle to make the post smaller

Damian

Spudhead
03-05-2003, 11:53 AM
OK, the code is full of minor things that may or may not be causing your error. Here's the code as I would clean it up, bearing in mind the following assumptions:

- tag attributes don't need quotes if they're integer values, but it doesn't matter if they have them. If they're text or percentages, they always need to be quoted.
- The <title> tag goes inside the <head> tag.
- Empty script tags are fairly useless.
- Microsoft Frontpage is completely useless.




<HTML>
<head>
<title>South Hill Mall</title>
<LINK rel="stylesheet" type="text/css" href="../css/normal.css">
<style type="text/css">
#instructions
{
position:absolute;
top:5px;
left:300px;
height:65px;
width:420px;
background-color: #ffffff;
border: 1px solid;
font-size: 10px;
margin: 3px;
}
p.page
{
page-break-after: always
}
</style>

</head>
<body>

Loop starts here

<center><h3>2/21/2003 South Hill Mall</h3></center>


<table border="1" cellspacing="1" width="100%" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellpadding="0" height="34">
<tr>
<td width="10%" class="Label" height=10 align="right">Date</td>
<td width="10%" class="Label" height=10 align="right">Pending</td>
<td width="16%" bgcolor="#FFFFFF" height=10><select name="Pending" id="Pending"><option value="no">no
<option value="yes">yes</select>
</td>
</tr>
</table>

<table>
<tr>
<td align="center" class="filled"></td>
</tr>
</table>
<p class="page">



Try that, see what you get. Bear in mind that if the rest of the code is like it, you'll needd to do a fair bit of cleaning up before you get to the real cause. Swear a bit, then ditch Frontpage :)

Roy Sinclair
03-05-2003, 03:10 PM
- tag attributes don't need quotes if they're integer values, but it doesn't matter if they have them. If they're text or percentages, they always need to be quoted.

Not quite correct. All tag attributes must always be quoted as of xHTML 1.0, don't give bad advice to people which will make them develop bad habits that will have to be broken later. Tags and their attributes should also always be all lower case too (the values for an attribute can be mixed or upper case but not the attribute name itself).

Microsoft Frontpage is completely useless Also not true, it's just mostly useless ;). Working only in the html view (ie never using the GUI editing) it makes an acceptable html text editor. I also prefer users to use Frontpage over MS Word which makes the ugliest, most garbage filled code I've ever had the bad luck to have to deal with.

ghornet
03-06-2003, 04:52 PM
thanks you guys for the help.. I guess it was the fact that I put my style tag outside of my head tag that was screwing things up. BTW I do not use frontpage... i do alot of copying and pasting for pages that I, or someone I work with already built... now I am going to have to go back and check all those pages hehe... have a great day

Damian