navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Free FrontPage Templates

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

alternate CSS stylesheet for IQY queries?

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets >> alternate CSS stylesheet for IQY queries?
Page: [1]
 
mtfm

 

Posts: 426
Joined: 1/13/2006
From: Mesa, AZ
Status: offline

 
alternate CSS stylesheet for IQY queries? - 7/12/2006 11:50:56   
I have a big list of tabular data on my site, which some users occasionally print-- or at least they would if I could get it to print without knocking off the left two columns. I did an alternate stylesheet for printing and everything, with the alt stylesheet knocking off everything but the content-- still no go. This is on a company intraweb, so 99% of the people ever looking at this are in IE 6.0 for windows, SP2.

What I'm thinking of doing now is to have the option of an IQY file, which will pull things into Excel. If I can specify an alternate stylesheet for Excel, then I can make it print the way I want it, since Excel has a little more flexibility.

But I don't know if it is possible. I assume it is, since you can do an alternate stylesheet for any specific browser, as well as for printing. I just don't know how to do it.


This is the javascript code I am using now for a stylesheet switcher for printing purposes.


Anyone who can help, I would be greatly appreciative!



<script language="javascript"> // This script allows the definition of a seperate stylesheet for printing.//

function styleSheetPicker()
{
   this.ieScreen = this.iePrint = this.otherScreen = this.otherPrint = "";
}

styleSheetPicker.prototype.render = function()
{
   if (document.createStyleSheet)
   {
    if (this.ieScreen)
     document.createStyleSheet(this.ieScreen);

    if (this.iePrint)
        {
     var ieP = document.createStyleSheet(this.iePrint);
            ieP.media = "print";
        }
   }
   else
   {
        var head = document.getElementsByTagName("head")[0];
    if (this.otherScreen != "")
            head.innerHTML += "<link rel=\"stylesheet\" href=\"" + this.otherScreen + "\">";

    if (this.otherPrint != "")
            head.innerHTML += "<link rel=\"stylesheet\" media=\"print\" href=\"" + this.otherPrint + "\">";

   }
}

var picker = new styleSheetPicker();

// IE stylesheets
picker.ieScreen = "../intraweb/js_files_and_site_pieces/stylesheet1.css";
picker.iePrint= "../intraweb/js_files_and_site_pieces/stylesheet_for_printing.css";

picker.otherScreen = "../intraweb/js_files_and_site_pieces/stylesheet1.css";
picker.otherPrint = "../intraweb/js_files_and_site_pieces/stylesheet_for_printing.css";

picker.render();

</script>
jaybee

 

Posts: 14191
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: alternate CSS stylesheet for IQY queries? - 7/15/2006 6:59:56   
You don't need to go to all that trouble, you can just use a print style sheet as well as a media style sheet.

Here's a really good article on it by one of the gurus.

Have fun.

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to mtfm)
mtfm

 

Posts: 426
Joined: 1/13/2006
From: Mesa, AZ
Status: offline

 
RE: alternate CSS stylesheet for IQY queries? - 7/19/2006 18:32:27   
Well, whaddya know.. it works. :) I swear I read somewhere that IE didn't support alternate stylesheets. I wouldn't have gone with all that ugly Javascript had I known this to begin with.


Thanks! You're a big help as always.

(in reply to jaybee)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets >> alternate CSS stylesheet for IQY queries?
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts