cancel
Showing results for 
Search instead for 
Did you mean: 

Export to Excel with colored row

Abhijit74
Active Contributor
0 Kudos

Hi,

I'm developing a alv report in web dynpro. The first requirement is to put traffic lights based on some criteria. This part has been done.

2nd requirement is to export this alv report into excel sheet. If traffic light of the row is 'RED' then in excel sheet it will be colored 'RED', if row is green excel sheet row will be 'GREEN' etc.

Thanks in advance for providing me solution of above problem I'm new to dynpro.

Thanks in advance,

Abhijit.

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi,

If u want color a row dynamically based on output data,first u should provide colour features to a new excel sheet and

save the file as XML file and open it in notepad.

like this append on the perfect place

APPEND INITIAL LINE TO p_t_xml_data

ASSIGNING <fs_xml>.

MOVE : '<Interior ss:Color="#FAC090" ss:Pattern="Solid"/>' TO <fs_xml>-tdline.

CONCATENATE text <fs_xml>-tdline cl_abap_char_utilities=>newline INTO text.

Abhijit74
Active Contributor
0 Kudos

Hello,

Can you please elaborate a bit.. I'm new to web dynpro. Can the standard 'Export to Excel' functionality will be enhanced?

where to write the things?

Is there any other way to achieve this functionality? Because the XML solution is bit lengthy process.

Thanks in advance,

Abhijit

Former Member
0 Kudos

Hi,

I don't think we have any other option currently apart from this.

marcin_cholewczuk
Active Contributor
0 Kudos

Hi,

You can use ABAP2XLSX project from Code Exchange platform.

Best Regards

Marcin Cholewczuk

Former Member
0 Kudos

Hi

even i am also using the same thing but i am getting error when trying to open the file is "this file is corrupt and cannot be opened  ".

please help

Thanks

Ashish

Former Member
0 Kudos

Hi ,

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.

OR you can go through this link and check if it can help you:

link : http://www.saptechnical.com/Tutorials/WebDynproABAP/Excel/Index.htm