?
Solved

asp:calendar and window.print();

Posted on 2006-11-09
7
Medium Priority
?
490 Views
Last Modified: 2013-12-03
I have a strange bug, I have a page with a asp:calendar control, I do plenty of
e.Cell.BackColor = System.Drawing.Color.Orange
to put colors in the days of the calendar, I end up with a pretty colorfull calendar. Then I do a window.print(); with javascript and it prints blank calendars... all the colors dissapear on the printing, I simply don't understand the reason of this behavior but I need to print that calendar.

Help please ?
0
Comment
Question by:Drakecoldwinter
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 16

Accepted Solution

by:
muzzy2003 earned 1400 total points
ID: 17909701
This is down to the printing in the browser. In IE, there is an option under Printing in the advanced options to enable background colour printing, but it's off by default.
0
 
LVL 2

Author Comment

by:Drakecoldwinter
ID: 17909825
Well, I got an easy and concrete answer that works well, so I will consider myself kind of happy with it. Now I have the whole background also printing wich I don't truly wish, but at the very least the calendars print, so I give you the points. thanks
0
 
LVL 16

Expert Comment

by:muzzy2003
ID: 17909841
Sorry the answer wasn't closer to what you wanted, but glad to help.
0
Python: Series & Data Frames With Pandas

Learn the basics of Python’s pandas library of series & data frames and how we can use these tools for data manipulation.

 
LVL 2

Author Comment

by:Drakecoldwinter
ID: 17909869
Well I wished to print the calendars with all the colors, now it works. The background is heavy and deranges the print through, but I found something about CSS @media print that I can use to maybe take off the background. At the very least now it's functional and I can print those calendars, so is just a look matter for the background. But your answer was 100% acurate.
0
 
LVL 2

Author Comment

by:Drakecoldwinter
ID: 17909910
I'm a happy man now, for further reference this has solved all my troubles and print a beautifull page with colorfull calendars and no background, thanks muzzy2003 :

@media print {
            BODY {background-color : White ;}            
             }
 @media screen{
      BODY {
      background-color : #003366;
      background-image : url(images/backgnd2.jpg);
      background-repeat : repeat-x ;
}}
0
 
LVL 16

Expert Comment

by:muzzy2003
ID: 17909931
Excellent. And I've learned something too. That's why I'm here, really!
0
 

Expert Comment

by:sheldondbrown
ID: 38554187
Hi all,

I'm running into the same issue that Drakecoldwinter was having, but enabling Print background colors and images isn't fixing the issue.  Given that this thread is from 2006, I was wondering if different settings needed to be tweaked using IE 8?  If anyone has any ideas they would be greatly appreciated.  Thanks so much.

EDIT:
Just in case someone comes along with a simlar problem.  In IE 8, there is another setting that needs to be checked.  See this kb article for details:

http://support.microsoft.com/kb/974128
0

Featured Post

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question