Click to See Complete Forum and Search --> : printing page


wmif
05-13-2005, 12:32 PM
ive always done formatted pages and allowed the user to print right out of IE on our intranet. im working on a project though right now that id like to have a more professional looking printout because this is gonna show to our customers. id like to be able to get rid of the title at the top and the address and page numbers at the bottom that IE puts there. what have you guys used to create forms?

Bullschmidt
05-16-2005, 12:59 AM
Here's a snippet from one of my .css files:

/* Print. */
@media print {
/* cssclsNoPrint class. */
.cssclsNoPrint {display:none}
}

/* Screen. */
@media screen {
/* cssclsNoScreen class. */
.cssclsNoScreen {display:none}
}

And I can include the .css file in a Web page's header:

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

And for something I want to show up on screen but not to show up when printing (or doing print preview):

<span class="cssclsNoPrint">
Blah, blah, blah
</span>

And for something I want to show up when printing (or doing print preview) but not on screen:

<span class="cssclsNoScreen">
Blah, blah, blah
</span>

phpnovice
05-16-2005, 07:12 AM
The above does not address the question asked. The original question refers to those things the browser adds that are not part of the actual content from the document being printed.

wmif
05-16-2005, 02:04 PM
i imagine that crystal reports could do something like this? ive never done anything with crystal and asp though.

lmf232s
05-16-2005, 02:13 PM
ya i have ran up against that problem here as well. Some of the users have just gone in and modified there browser setting to exclue the header and footer. I personally like them, as im able to print a page and know where they page if from. Any way a solution to the problem would be to craete a txt file, or word doc on the fly with the data from the screen. This way your not printing the web browser page but the report. You could always display the page with all the data and then have a link that when pressed would open a new page but the page could have the response.contenttype = word (not the actual code) and then the page would render as a word doc, that you could open or save. Also you could just create a txt doc the same way.

Put this as one of the first lines

Response.ContentType = "application/msword"

and it will render the page as a word doc.
This might help you

wmif
05-16-2005, 02:25 PM
thats a really great way to do this, but im gonna have to avoid that. i have enough trouble with users going outside the various systems we have in place for their tasks. the last thing i want them to do is start saving these word files. ive created this system because the previous "system" was very manual involving many large excel sheets being emailed from remote users over a dialup connection and the main guy getting the emails is manually retyping stuff into an access db then again into the as400 db. ihhh.

wmif
05-25-2005, 04:57 PM
found this page that explains many different options.

http://www.15seconds.com/issue/981216.htm

weve got crystal enterprise running other reports but dont know how to get reports to take data that i need to pass it. i found the sample download pack and am working through it right now to see if this (hopefully) will do what i need.

wmif
05-27-2005, 06:19 PM
YEEEEESSSSSSSS!!!!!!

got it working. details if anyone is interested.

lmf232s
05-27-2005, 11:24 PM
please do

lamore
05-28-2005, 06:58 AM
I would be interested in how you solved this for I have the same problem, also when you have a webpage print it prints the print button also. my email address is
lamore49@yahoo.com


Thanks,
Lenny

phpnovice
05-28-2005, 07:31 AM
... when you have a webpage print it prints the print button also.
That is easy to solve -- and no JavaScript required:

<style type="text/css">
<!--
@media screen {
.display_only {
visibility: visible;
}
}
@media print {
.display_only {
visibility: hidden;
}
}
-->
</style>

Then, just specify that class name in your print button's attributes.

EDIT: From my reading, it seems that you can also do this:

<button type="button" media="screen" onclick="top.print(); return true;">Print</button>

wmif
05-31-2005, 04:12 PM
in order for this to work you have to have a developer edition of crystal reports. install this on the server to get the runtime dll's and such registered. they have a download file that you get that will extract to your web folder and give you a ton of samples of different options you have. im going against a sql server so i had to use the "setlogoninfo" and to tell it which records to get i used the parameter passing.