|
-
Jan 31st, 2006, 06:02 AM
#1
Thread Starter
Fanatic Member
Printing the Page
I have an ASP.NET project using VB.NET 2003.
Is it possible to get the browser to print the current page but skip the print dialog and default to landscape?
I have been presuming that this will need to be done client side, but is that true?
Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment. 
-
Jan 31st, 2006, 09:49 AM
#2
Re: Printing the Page
Not unless you plan on using an ActiveX control on your page that can control the printer.
-
Jan 31st, 2006, 10:02 AM
#3
Thread Starter
Fanatic Member
Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment. 
-
Jan 31st, 2006, 12:25 PM
#4
Re: Printing the Page
ActiveX is not the way to go unless the Web page is being saved to someone's local hard disk.
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
Jan 31st, 2006, 05:18 PM
#5
Re: Printing the Page
I'm very interested on this thread.
So, Lord_Rat, how would you do it? And why the ActiveX is not the way to go?
Thanks
HoraShadow
I do like the reward system. If you find that my post was useful, rate it.
-
Feb 1st, 2006, 05:09 AM
#6
Re: Printing the Page
ActiveX is malicious and not something that most educated users (and newer browsers) trust. In effect, this new ActiveX you create will reach only, say, 20% of the users that access that page.
The other option is to use a reporting control that can render the tables/content in PDF format and then (possibly) specify orientation from there. Options for this are MS SQL SERVER REPORTING SERVICES and Crystal Reports.
-
Feb 1st, 2006, 12:24 PM
#7
Re: Printing the Page
PDF is a good option, yes.
For now I guess the best option is just to make it to where the user can print however they want and it wont be messed up by that.
Eventually, the CSS 2.0 specification will finalize and browsers will support it. When that happens, printing control is part of the specification.
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
Feb 1st, 2006, 12:41 PM
#8
Re: Printing the Page
Oh, I see. That makes a lot of sense.
So, how do you guys normaly print? you make the file PDF and print it? Does the client need the adobe reader installed for it to work and print?
Is there any other better way to print than using javascript document.print() ?
What would be the "elegant" way of printing?
Do I create another thread for my questions, or here is fine?
Thanks
HoraShadow
I do like the reward system. If you find that my post was useful, rate it.
-
Feb 1st, 2006, 04:59 PM
#9
Re: Printing the Page
Here is fine and you have to ask what your target audience is and whether you have the programming finesse to program a PDF version of whatever they want to print.
How I handle it is to mark certain elements of the page as not-printing and leave the rest up to the user. I just make sure as a designer that the page can be printed reasonably using the defaults from the printer setup.
If it is imperative that a special form of printing be used, then include instructions on how to set up the page in a non-printing box.
If you want me to demonstrate how to make something show on a web page but not the printed output, say so and I will give you code.
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
Feb 3rd, 2006, 12:24 PM
#10
Re: Printing the Page
Yes please, if you could, it would be very appreciated!
Thanks
HoraShadow
I do like the reward system. If you find that my post was useful, rate it.
-
Feb 3rd, 2006, 12:39 PM
#11
Re: Printing the Page
In the HEAD section, add:
<STYLE type="text/css">
.noPrint, *.noPrint, .noPrint * {printing: no}
</STYLE>
Then, place all of your content that should not print inside a DIV with a class of noPrint, like so:
<DIV class="noPrint">
This will show on the Web page, but will not print out.
</DIV>
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
Feb 3rd, 2006, 01:13 PM
#12
Re: Printing the Page
Hey, that's very cool!
It will come very handy.
Thanks!
HoraShadow
I do like the reward system. If you find that my post was useful, rate it.
-
Feb 3rd, 2006, 01:15 PM
#13
Re: Printing the Page
Yeppers! I find that using that lets me make a page that is both Web-friendly and print-friendly about 90% of the time.
The rest of the time, who cares? =)
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|