Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 557
  • Last Modified:

default to landscape when hit print button in asp.net

I would like to give our users the ability to print the results with a PRINT button .  The data is in an aspx display and contains a data grid. Current attempts to print have resulted in a loss of the right margin of the data grid.  We would like a solution that either prints the whole grid in portrait format, or defaults to landscape for the user.  I was working with CSS but it seem like there no luck for that since CSS itself has it own bug. Please help would be appreicate.
0
missqti
Asked:
missqti
  • 8
  • 5
1 Solution
 
GrandSchtroumpfCommented:
An html page is not supposed to change the user's print settings.
If the user wants to print in landscape, he/she can simply set that in the print properties.
0
 
missqtiAuthor Commented:
I know the user can set the landscape in print properties. There is no way you can default to landscape so user doesn't have to do anything?

It possible you can do that in SQL Server Reporting Services but never done anything like that before. Does anyone know how to do it in Reporting Services?
0
 
GrandSchtroumpfCommented:
> There is no way you can default to landscape
Not using standard code.

There is a buggy way of using some CSS transform to rotate the page, but that only works in IE and does not seem to be working very well from the feedback i got on this forum.
Or there is an ActiveX component that allows you to communicate directly with the printer, but i never used it (COBOLdinosaur often mentions it)... and it's quite expansive too.
Another possibility is to use PDF format.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
GrandSchtroumpfCommented:
> We would like a solution that either prints the whole grid in portrait format
That's easy: use Firefox, it has a "fit to page" feature for printing.
For IE, you can use CSS reduce the font size untill it all fits on one page.
0
 
GrandSchtroumpfCommented:
For more info on css / print medium:  http://www.alistapart.com/articles/goingtoprint/
0
 
missqtiAuthor Commented:
What is FireFox? Is that a tool for printing? Does it cost any money? I'm looking for no cost at all. I'll try to look at the link you provided above to see if it help.
0
 
GrandSchtroumpfCommented:
Firefox is the latest browser of the Mozilla family (like what Netscape uses).
http://www.mozilla.org/products/firefox/

But if you developped you site using MS products, there is a good chance your site won't look good in Firefox.  Firefox respects the latest W3C standards that IE does not respect, so it's better to use it as a reference for testing a website.  However, it does not support MS proprietary stuff such as VBScript and ActiveX that you might use if you design an intranet application.
0
 
missqtiAuthor Commented:
I guess Firefox wouldn't work for me. I'm using IE for intranet application using asp.net.
0
 
GrandSchtroumpfCommented:
as long as your application uses standard html and javascript, you should be able to use it with any browser... but i understand your position.

anyway, there is no easy way to force printing in landscape, that's for sure.  html tables are not a good format for printing, especially in IE.
0
 
missqtiAuthor Commented:
I solved the problem myself by making the font on the datagrid smaller, abbreviation the fields name. The output of datagrid looking OK for printing out as the portrait.
0
 
GrandSchtroumpfCommented:
I beleive i answered the question.
0
 
missqtiAuthor Commented:
The points will go to GrandSchtroumpf for all the good info even thought I solved the problem myself.
0
 
GrandSchtroumpfCommented:
<:°)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 8
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now