Skip to Content
0
Dec 26, 2003 at 08:18 PM

Source code for providing Save as option on Web Report

32 Views

Hi All,

My client wants to provide download options on top of report in addition to context menu options.

They want to download Web Report as CSV/text file. I tried to use following code but doesn't mee tmy requirement.

Step 1.: The Script

-


Insert the following script in the head of the page:

<script language="JavaScript">

// Source: CodeFoot.com

// Please leave in this header.

var isReady = false;

function doSaveAs(){

if (document.execCommand){

if (isReady){document.execCommand("SaveAs");}

}else{

alert('Feature available only in Internet Exlorer 4.0 and later.');

}

}

</script>

Step 2.: The Body Tag Interlock

-


Include the following onload event call in the body tag. This stops

the script from functioning until the page is fully loaded.

<body onload="isReady=true">

Step 3.: The Link

-


To call the script from the page and activate the SaveAs dialog,

insert a link in the page like this:

<a href="javascript:doSaveAs()">

Click Here To Save This Page

</a>

If anyone has worked on similar options please let me know.

It should take only the data and not the images. When it takes images it looks bad.

Please advice asap.

Thanks & Regards,

Ajay