cancel
Showing results for 
Search instead for 
Did you mean: 

Source code for providing Save as option on Web Report

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ajay,

why not using the Web-API Command Export (Command for a data provider)?

See online Documentation:

http://help.sap.com/saphelp_bw33/helpdata/en/33/f3843b0af3de0ee10000000a114084/frameset.htm

Regards

Heike