Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can i make a breakpage with dhtml?

Status
Not open for further replies.

Nicky

Programmer
Nov 28, 2000
9
0
0
US
i have a long report to print from a html page. My HTML page contains different kind of car what i want exactly is to put a break page after each category of car.
can i do it in dhtml or with any script??

thanx in advance

Nicky

 
How is the data produced for the page?? By that, I mean are you reading it from a database??

If you are reading it from a database, then you can view one category at a time, with Next / Back buttons to show the next / previous group of cars. - Call the same page passing the previously shown Category as a parameter (in the URL I normally do it) and a direction parameter. Create the SQL statement on the fly to pull the correct records from the database.

Simon
 
if you d'ont want to query a db, i guess there must be something to do with the onbeforeprint event ...
 
in fact, it is an asp page that i read data from a database.
Williams, with the way u do, can i click on print once and it will print all the pages?
if not, it's could be a bit too long to print about 500 pages with NEXT/BACK button .

thanx
ps, thank you iza, i am new in dhtml so i can't do it without an example.
 
well i hoped someone would say "yes, do THIS with the onbeforeprint" because i've never managed to make it work :-(

it's an event that is fired before the page prints, so if you want to do any specific treatement on the page before it is printed, you should use it


 
I have the code below but it doesn't work,
somebody finds any mistake here???

<html>
<head>
<STYLE>
P.page {page-break-after: always}
</STYLE>
</HEAD>
<BODY>
<P CLASS=page>
.
content on page 1
.
</P>
.
content on page 2
.
.
</P>
</body>
</html>
 
If you want to print out the entire set of pages from one button, you could just set up another page to do this. Then the user has two options, print the page being viewed, or print the entire &quot;document&quot;.

Simon
 
hey nicky maybe you should open the second <P>
but i guess you have to *create* the page box - using @page
 
You might need to open the second &ltP> as iza suggests. Also, what browser you using to test it? Last time I checked, no version of NS supported any way to insert page breaks. But with opening the 2nd &ltP>, that should work in IE just fine (I've made multiple reports that take advantage of the page-break-after).
 
i am using this code and it works now with IE
<html>
<body>
<P STYLE=&quot;page-break-after='always'&quot;>
...
<P STYLE=&quot;page-break-after='always'&quot;>
..
</body>
</html>

thanx Borbardier
 
In HTML it´s simply a button using the URL to next page.
Where is the problem?
Is it necessary to make one 3 feet page ? The transfer time
for this page will be unpleasant long. ---G.Hoffmann
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top