Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 7th, 2007, 1:32 PM   #1
somehollis
Programmer
 
somehollis's Avatar
 
Join Date: May 2006
Location: Memphis, TN
Posts: 31
Rep Power: 0 somehollis is on a distinguished road
Send a message via AIM to somehollis
CSS for print media and background colors

A web app I've been building has the final result of generating a report for the end user. I'm trying to whip up some css for print media so that they can print it w/out wasting ink/paper on all the other junk on the screen.

The only real problem I'm having is aesthetic. When the report table is generated server side, I'm setting the background of every other row to be a very light gray (see attached jpg) to make large tables a little bit easier to read. This is done with the standard
#report tr.odd {
   background-color: #eee;
}
It seems that all the major browsers turn off background colors when printing (for obvious reasons), but I lose my stripes.

Does anyone know another way to achieve this same effect?
Attached Images
File Type: jpg report_sample.jpg (55.2 KB, 39 views)
somehollis is offline   Reply With Quote
Old Mar 7th, 2007, 4:25 PM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
I would recommend using ezPDF, which is free, or something similar. Here's a reproduction of one of my reports. It has been compressed 85%, so allow for the artifacts caused by that.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Mar 8th, 2007, 12:28 AM   #3
somehollis
Programmer
 
somehollis's Avatar
 
Join Date: May 2006
Location: Memphis, TN
Posts: 31
Rep Power: 0 somehollis is on a distinguished road
Send a message via AIM to somehollis
Sounds like that is probably the best solution. I searched a little more, and the only non-pdf option I came up with was to instruct the user to set their browser to print background colors. I can safely bet that this is a little much to ask of some of my users...

My site is written in python, so it looks like reportlab is going to be my best bet for pdf generation. Have you ever used it?
somehollis is offline   Reply With Quote
Old Mar 8th, 2007, 6:51 AM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Sorry, I haven't.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Do you know this kind of media player? java_roshan Coder's Corner Lounge 3 Aug 10th, 2006 12:46 PM
Media application ahmedsh5 Other Programming Languages 4 Mar 17th, 2005 3:48 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:21 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC