Reply
Printing a page
Old 05-31-2006, 05:44 AM Printing a page
Skilled Talker

Posts: 95
Hi guys,

I have a ASP site where a user will use various forms to fill in small sections of a larger form. When this larger form is submitted. It will generate a report, the layout of which will differ slightly depending on the information entered

i.e it could be layout 1,2,3 or 4

When the user submits the form or presses the button i want the correct report to automatically be printed.

i know the code to figure out what layout to use. I just need help on the printing of the report.

I'm guess i could do:
press button
load report in window
print window.

but i would like the report to print with out the user having to see it on the screen first. is this possible?
higginbt is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 05-31-2006, 06:32 AM Re: Printing a page
chrishirst's Avatar
Super Moderator

Posts: 12,579
Location: Blackpool. UK
It would have to be rendered first

No immediate way I can think of to print without the user seeing it without causing some security alerts to popup
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-01-2006, 12:21 PM Re: Printing a page
funkdaddu's Avatar
Web Design Snob

Posts: 636
You could use CSS to hide the form on a page, then when it is printed, use a print-only stylesheet to show the info. So the screen will not show the data, but when it is printed it would.
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

	<head>
		<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
		<title>Untitled Page</title>
		<style type="text/css" media="screen"><!--
.printInfo {
	display: none
	}
	
.screenInfo {
	display: block
	}

--></style>

		<style type="text/css" media="print"><!--
.printInfo {
	display: block
	}

.screenInfo {
	display: none
	}

--></style>
	</head>

	<body bgcolor="#ffffff">
		<div class="screenInfo">
			<h1>This Text is for the Screen only</h1>
			<p>Si meliora dies, ut vina, poemata reddit, scire velim, chartis pretium quotus arroget annus. scriptor abhinc annos centum qui decidit, inter perfectos veteresque referri debet an inter vilis atque novos? Excludat iurgia finis, &ldquo;Est vetus atque probus, centum qui perficit annos.&rdquo; Quid, qui deperiit minor uno mense vel anno, inter quos referendus erit? Veteresne poetas, an quos et praesens et postera respuat aetas?</p>
			<p>&ldquo;Iste quidem veteres inter ponetur honeste, qui vel mense brevi vel toto est iunior anno.&rdquo; Utor permisso, caudaeque pilos ut equinae paulatim vello unum, demo etiam unum, dum cadat elusus ratione ruentis acervi, qui redit in fastos et virtutem aestimat annis miraturque nihil nisi quod Libitina sacravit. </p>
			<button name="buttonName" type="button" onclick="window.print();">Print this Page!</button>
		</div>
		<div class="printInfo">
			<h1>This Text is to be Printed only</h1>
			<p>Ennius et sapines et fortis et alter Homerus, ut critici dicunt, leviter curare videtur, quo promissa cadant et somnia Pythagorea. Naevius in manibus non est et mentibus haeret paene recens? Adeo sanctum est vetus omne poema. ambigitur quotiens, uter utro sit prior, aufert Pacuvius docti famam senis Accius alti, dicitur Afrani toga convenisse Menandro, Plautus ad exemplar Siculi properare Epicharmi, vincere Caecilius gravitate, Terentius arte. <br>
				Hos ediscit et hos arto stipata theatro spectat Roma potens; habet hos numeratque poetas ad nostrum tempus Livi scriptoris ab aevo. </p>
			<p>Interdum volgus rectum videt, est ubi peccat. Si veteres ita miratur laudatque poetas, ut nihil anteferat, nihil illis comparet, errat. Si quaedam nimis antique, si peraque dure dicere credit eos, ignave multa fatetur, et sapit et mecum facit et Iova iudicat aequo.</p>
			<p>Non equidem insector delendave carmina Livi esse reor, memini quae plagosum mihi parvo Orbilium dictare; sed emendata videri pulchraque et exactis minimum distantia miror. Inter quae verbum emicuit si forte decorum, et si versus paulo concinnior unus et alter, iniuste totum ducit venditque poema.</p>
		</div>
	</body>

</html>
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Reply     « Reply to Printing a page
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12397 seconds with 13 queries