Link to home
Start Free TrialLog in
Avatar of bender007
bender007

asked on

Print and Page Break in IE7

I use this code to insert page break in a HTML report that I dsiplay on a Webpage.However when i try to print it , it would have white space filled on the top and bottom portion of the text.

Eg:

 strReport = "<pre>" & vbCrLf
 strReport = strReport & "TEXT"
 strReport = strReport & "</pre>" & vbCrLf
 strReport = strReport & "<br style=""page-break-before:always"">" & vbCrLf
 strReport = strReport & "<pre>" & vbCrLf
 strReport = strReport & "TEXT2"
 strReport = strReport & "</pre>"
Avatar of cezarF
cezarF
Flag of Australia image

try without the <pre> tag

 'strReport = "<pre>" & vbCrLf
 strReport = strReport & "TEXT"
 'strReport = strReport & "</pre>" & vbCrLf
 strReport = strReport & "<br style=""page-break-before:always"">" & vbCrLf
 'strReport = strReport & "<pre>" & vbCrLf
 strReport = strReport & "TEXT2"
 'strReport = strReport & "</pre>"
Avatar of bender007
bender007

ASKER

Nope. That did not work. The page breaks did not take effect.
My original problem was ;some pages would be fine without any whitespaces but the first few would have whitespace at the top.
you will see the break if you do a print-preview...
The page did not break at that point. It was just one continous page.
this is what i did to test. print preview shows 2 pages. with the <pre> there's a white space on top of page 2
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>

<BODY>
 TEXT
 <br style="page-break-before:always">
 TEXT2
</BODY>
</HTML>
Removal of the <pre> tags results in my existing text loosing its formatting. The text I use has some HTML formatting .
ASKER CERTIFIED SOLUTION
Avatar of cezarF
cezarF
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Forced accept.

Computer101
EE Admin