Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Force new page

 
Ranch Hand
Posts: 837
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have a report generated from a database retrieve statement. The page(s) that come from the report have headers on each page. Sometimes each page will have different fonts added to the text. Is there a way of inserting some code or escape sequence in the HTML document that could force a particular section onto a new page? For example, if I printed I could print, let's say, 50 lines. The report that came back from the database retrieve takes up 40 lines in the HTML "page preview" and the header of the next page from the retrieve shows up (10 HTML equivalent lines). Basically I want to know if there is a way I could edit the document and insert something after the last line of the retrieve report (basically on line 41 of the HTML document) that could force a new page? Really appreciate help on this one.

Thanks.
Rob
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CSS has stuff about page breaks, not sure if that would help. Here is an article on the matter: http://www.htmlgoodies.com/beyond/css/article.php/3470341

The only soluntion I could think for the way you explained it is rather ugly in my eyes.

Have a parent page that gets code that determines how many lines are in your report. This page then opens up pop up windows that sends out a query string to a page that says lines reportGrabber.jsp?startLine=200&endLine=300

I blogged here about controlling multiple pop up windows:
http://radio.javaranch.com/channel/pascarello/2005/01/19/1106152877000.html

The blog talks about closing them, you can also make it print all of them etc. Why it is ugly. If you want a person to print the windows then it will require a prompt for every window. If you are talking about IE only, then you could look into activeX to control the printing. The printing could be as easy as onload events on the "reportGrabber.jsp" page or a function that is called on the parent(opener) page.

Hope that helps you out a little, no real easy solution.
Eric
 
Liar, liar, pants on fire! refreshing plug:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic