View Single Post
  #6 (permalink)  
Old June 23rd, 2007, 12:11 AM
zaerymoghaddam zaerymoghaddam is offline
Authorized User
Join Date: Jun 2007
Location: Tehran, Tehran, Iran.
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts

Hi arnabghosh

Your stylesheets are defined in HEAD element of document and when you copy inner html of document to hidden frame, copy operation will be done just for body contents (not header of document).

I think you can create your frame stylesheets dynamically using 'createStyleSheet' method of 'document' object. You should do this after setting content of frame and just before saving it, and repeat it for every style link element in page header. So again, your 'openSaveReportDialogue' method will be changed to :

function openSaveReportDialogue()
    document.getElementById("SaveImg").style.display = 'none';
    document.getElementById("PrintImg").style.display = 'none';
    document.getElementById("saveFrame").document.writ e(document.body.innerHTML);
    for(var i=0; i<document.styleSheets.length; i++)
        document.getElementById("saveFrame").document.crea teStyleSheet(document.styleSheets[i].href);

Have a nice save!

Ehsan Zaery Moghaddam
Reply With Quote