View Single Post
  #2 (permalink)  
Old June 17th, 2007, 03:44 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
Default

When you try to save a document, browser will send a new request to server and retrieves a new copy of your page (and also all of it's resources) and let user choose an appropriate location to save newly downloaded document. As your 'Save' and 'Print' buttons are visible in newly downloaded page, they will be visible in saved one too.

I think you can place a hidden IFRAME (like <IFRAME id="saveFrame" style="display:none"></IFRAME>) in your page and replace your 'openSaveReportDialogue()' method with something like this :

function openSaveReportDialogue()
{
    document.getElementById("SaveImg").style.display = 'none';
    document.getElementById("PrintImg").style.display = 'none';
    document.getElementById("saveFrame").document.writ e(document.body.innerHTML);
    SaveReport();
}

Using this approach, you will fill 'saveFrame' with your current document's content (not the original one) and as you are hiding buttons just before doing this, they will not appear in frames content.

Also notice that you should change your 'SaveReport' implementation as below :

function SaveReport()
{
    document.getElementById("saveFrame").document.exec Command('SaveAs',1,'PASSReportMain');
    document.getElementById("SaveImg").style.display = 'block';
    document.getElementById("PrintImg").style.display = 'block';
}

In this implementation, you will save contents of 'saveFrame' instead of main document
Reply With Quote