cancel
Showing results for 
Search instead for 
Did you mean: 

Cell Formatting in excel - Webdynpro ABAP

Former Member
0 Kudos

Hi,

I have Webdynpro ABAP component. In this I am downloading some internal table data into spread sheet using following code. I need to Format data like giving Cell coloring. Could any one please tell me where i can make this format in WebDynpro ABAP.



  CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
    EXPORTING
      text   = ls_text
    IMPORTING
      buffer = ls_xtext.

  wdr_task=>client_window->client->attach_file_to_response(
**path to the word file
     i_filename = 'WDP.xls'
* String Variable
     i_content =  ls_xtext
* File Type
     i_mime_type = 'EXCEL' ).

Thanks,

Sekhar.J

Edited by: sekhar J on May 3, 2010 11:50 AM

Accepted Solutions (0)

Answers (3)

Answers (3)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

How are you actually building the string LS_TEXT? If this is tab delimited string then this file type doesn't support any cell formatting. This is an Excel limitations not a Web Dynpro one. If you need cell formatting you must use the Excel XML format. Build a spreadsheet with the features you want and then choose save as XML from within Excel. Then look at the resulting file with a text editor to see how the XML format is built. This is what you need to duplicate in ABAP using Concatenations, the iXML library or XSLTs.

Former Member
0 Kudos

Hi Thomas ,

could you please tell me how to excel file as XML data.because i also have the requirement .

Former Member
0 Kudos

Hi Ashish

You can convert excel as XML by File ->save as -> XML Data  ..

if you get error as

"cannot save XML data because the workbench does not contain any XML Mapping"

Then try to save File ->save as -> XML spreadsheet 2003 format

And then open the excel in note pad you will get the XML Data

below is the tutorial for cell formating in excel using XML data

http://scn.sap.com/docs/DOC-25024

Regards

Chinnaiya Pandian

Former Member
0 Kudos

HI Chinnaiya,

i have followed the steps as given in the document but i am getting the xlm code in downloaded file.

shishupalreddy
Active Contributor
0 Kudos

Hello,

We did the saved the excel in  Excel XML format and duplicated the code using concatenations as given in thread http://scn.sap.com/docs/DOC-25024

.But I always see the below error

XML PARSE ERROR:  Missing whitespace between attributes

  Error occurs at or below this element stack:

    <ss:Workbook>

     <ss:Worksheet>

But the XML tags are concatenated as well in to field of type STRING .

Please advise how to resolve this .

Thanks

Shishupal.

Former Member
0 Kudos

Hi,

You can download the contents to Excel with this method cl_wd_runtime_services=>attach_file_to_response

For further please check the follwoing wiki

[Download a file into excel sheet|http://wiki.sdn.sap.com/wiki/x/AANqBg]

Hope this solves the issue,Let me know if you have any queries.

Thanks,

Rajani

Former Member
0 Kudos

Up to my knowledge, we cann't set the Cell colouring of the Excel using Web dynpro. Let wait for other Gurus replies on the same.