Escolar Documentos
Profissional Documentos
Cultura Documentos
Download data from web ui to Excel and PPT - CRM - SCN Wiki
Getting Started New sletters
Welcome, Guest
Login
Register
Store
Products
About SCN
Downloads
Industries
Partnership
Developer Center
Lines of Business
University Alliances
Innovation
Applies to:
CRM 6.0/7.0
Summary
Dow nload data from w eb ui to Excel and Pow erpoint presentation w ith formatting options using ActiveXObjects and Javascript.
As an alternative for an Excel Export that doesn't require ActiveX check out WebClient UI Export to Spreadsheet w ith abap2xlsx
Author(s):
Com pany:
Accenture
Created on:
May'11 - 2010
Author(s) Bio
Arun Kumar is a CRM developer w orking w ith Accenture India.
Exporting data to a file from w eb ui is already available in CRM but it is limited to certain file types. For example data cannot be dow nloaded to an Excel file or Pow erpoint presentation. The 'Export to
Excel' button available in tableview tag dow nloads the file as an XML spreadsheet and not to an Excel file.
This w iki explains how to dow nload data to an Excel file and Pow erpoint presentation using ActiveXObjects in Javascript. We do not use SICF service or any handler class.
I have created a value node and populated some data and displayed it in a Table View and added a button 'Dow nload to Excel' w hich triggeres the Javascript function 'dow nload()' onclientclick. The
entire dow nload function is w ritten in the page layout.
( Note: I w as not able to save the w iki w ith standard scripting and activex keyw ords. So i have added the coding as im age as per the advice from SDN support)
Workbook = Excel.Workbooks.Add();
This reference variable 'Workbook' has a list of properties and methods that can be used to format the Excel file further. These are available in the Microsoft msdn library.
Now w e can directly add values to the Excel sheet that is active in the Excel w orkbook.
Workbook.ActiveSheet.Cells(1,1).Value = "Hello";
This statement w rites the value 'Hello' to cell 1:1 of the first sheet in the Excel file.
Adding background color to a range of cells,
Workbook.ActiveSheet.Range("A1:F1").Interior.ColorIndex = 43;
http://wiki.scn.sap.com/wiki/display/CRM/Download+data+from+web+ui+to+Excel+and+PPT
1/6
11/13/2014
Download data from web ui to Excel and PPT - CRM - SCN Wiki
Excel.Visible = "true";
The file can be saved directly to the user desktop.
Workbook.SaveAs( <filename>);
Download to PPT
Create a pow erpoint application using AXO.
myApp.Visible = true;
Tableview:
Coding:
http://wiki.scn.sap.com/wiki/display/CRM/Download+data+from+web+ui+to+Excel+and+PPT
2/6
11/13/2014
Download data from web ui to Excel and PPT - CRM - SCN Wiki
http://wiki.scn.sap.com/wiki/display/CRM/Download+data+from+web+ui+to+Excel+and+PPT
3/6
11/13/2014
Download data from web ui to Excel and PPT - CRM - SCN Wiki
http://wiki.scn.sap.com/wiki/display/CRM/Download+data+from+web+ui+to+Excel+and+PPT
4/6
11/13/2014
Download data from web ui to Excel and PPT - CRM - SCN Wiki
download
excel
ppt
activex
crm
webclientui
webui
5 Comments
Uday Kumar Reddy Velagacharla
Hi Arun,
I got the similar kind of requirement for dow nloading the data into Excel from UI. I did the same steps but w hen i had clicked on the button in w hich excel dow nload has to be done, nothing is
happening. Could you please let me know any more steps required inorder to trigger the logic behind the button.
If you dont mind, could you please provide your mail id so that i can explain more by giving screenshots.
Thanks & Regards,
Uday
Gregor Wolf
Hi Uday,
I think the approach show n by Arun could be problematic in a environment w here you can't use Microsoft Internet Explorer. A better idea if you need nicely formatted Excel files is the
abap2xlsx project available at https://cw .sdn.sap.com/cw /groups/abap2xlsx. A standard solution for Excel dow nloads is the Excel dow nload available in all table view s.
Best regards
Gregor
http://wiki.scn.sap.com/wiki/display/CRM/Download+data+from+web+ui+to+Excel+and+PPT
5/6
11/13/2014
Download data from web ui to Excel and PPT - CRM - SCN Wiki
ArunKumar Balakrishnan
Hi Gregor,
The abap2xlsx project dow nloads the file in .xlsx format (Open XML Format Spreadsheet file) and not in an Excel format. .Xlsx file is similar to a zipped file package of XML spreadsheets. And
the standard 'Export to Excel' available is table view , DOWNLOADS XML FILES and not Excel files. The 'Export to Excel' event handler class is CL_CHTMLB_CONFIG_TAB_EXCEL_EXP.
Hi Uday,
My mail id is available in my business card.
Regards,
Arun
Gregor Wolf
Hi Arun,
as there are free converters for older Excel Version to read the XLSX format I don't see a problems here. The Export to excel w orks also fine in Excel 2003.
Best regards
Gregor
Guest
Hi Arun,
I am also using the same code w hat you suggested . But nothing is happening and i am getting java script error as mentioned below .
1. I tried to get your email id through your business card but i am not able to see it. Could you please send me your email id.
You can send it on my email id kapilkumar.nitj@gmail.com
2. Also can you please tell is there any special setup needed for active x object.
Please provide me your valuable inputs for this requirement. I w ill really appreciate your help.
syntax error.
1. BSPWDAPPLICATION.DO
2. OBJECTEXPECTED
EVENT.JS
Thanks & Regards,
Kapil Kumar
Contact Us
Privacy
Legal Disclosure
Copyright
Follow SCN
This ad is supporting your extension ruul (screen ruler): More info | Privacy Policy | Hide on this page
http://wiki.scn.sap.com/wiki/display/CRM/Download+data+from+web+ui+to+Excel+and+PPT
6/6