View Full Version : printing data from web page to preformated A4 size paper

10-26-2006, 12:31 AM
Hi frieds,
I have a problem at my work place to be solved.There is an asp webpage which displays 5 records from database.The web page is having print buton.We have to write a program in such a way that if user presses this button .each record has to be printed on a seperate a4 size preformated paper.Can you please give me sample code to that in ASP or with using CSS.
Waiting for your post

10-26-2006, 11:37 AM
Well firstly you could to set up a print stylesheet which will be used only for printing. You don't have to but it would be easier to keep the styling for the printed page and the screen page seperate.

<link rel="stylesheet" type="text/css" href="print.css" media="print" />

In that stylesheet you'll be able to define how the page should print (use Print Preview to check how it looks).

You can use the CSS property page-break-before:always to force a page-break before an element.