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

Source code for providing Save as option on Web Report


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:

// Please leave in this header.

var isReady = false;

function doSaveAs(){

if (document.execCommand){

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


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




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


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,