Solved

Print and Page Break in IE7

Posted on 2007-11-14
9
1,075 Views
Last Modified: 2012-05-05
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>"
0
Comment
Question by:bender007
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
9 Comments
 
LVL 14

Expert Comment

by:cezarF
ID: 20286113
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>"
0
 

Author Comment

by:bender007
ID: 20286436
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.
0
 
LVL 14

Expert Comment

by:cezarF
ID: 20286505
you will see the break if you do a print-preview...
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:bender007
ID: 20286569
The page did not break at that point. It was just one continous page.
0
 
LVL 14

Expert Comment

by:cezarF
ID: 20286633
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>
0
 

Author Comment

by:bender007
ID: 20290426
Removal of the <pre> tags results in my existing text loosing its formatting. The text I use has some HTML formatting .
0
 
LVL 14

Accepted Solution

by:
cezarF earned 500 total points
ID: 20294326
i changed the page-break to after. looks alright. nomore white space on the print preview.

<br style="page-break-after:always">
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20521806
Forced accept.

Computer101
EE Admin
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question