03-02-2017 4:09 AM
Dear Experts,
I have Created Multiple Sheets Colored Excel by Using XML Code in ABAP. Now the requirement is Each Excel Work Sheet Tab Should have a Color.
I have used the below Code in the program ( Mentioned in BOLD Letters) for Tab Color and its not working.
r_worksheet = l_document->create_simple_element( name = 'Worksheet' parent = l_element_root ).
r_worksheet->set_attribute_ns( name = 'Name' prefix = 'ss' value = lv_value ).
r_worksheet->set_attribute_ns( name = 'TabColor.Rgb' prefix = 'ss' value = 'Red' ).
Please tell me how to apply colors for Excel Tabs Using XML Code in ABAP.
Regards,
Nagaraju Adhikari
03-02-2017 7:55 AM
Hello
Please use some of this sample to test if it works for you :
"Create style-tableheader
lr_ixml_style = lr_ixml_document->create_simple_element( name = 'Style' parent = lr_ixml_styles ).
lr_ixml_style->set_attribute_ns( name = 'ID' prefix = 'ss' value = 'Header' ).
...
lr_ixml_format->set_attribute_ns( name = 'Color' prefix = 'ss' value = '#00CCFF' ).
Some references I used in the past :
03-02-2017 8:57 AM
Dear Nic,
Thank you for your response. I have tried with given sample code but still its not working.
Thanks & Regards,
Nagaraju Adhikari
03-02-2017 12:22 PM
Hello
I didn't see your reaction because you posted it as a new "Reply" rather than a "Comment" ...
But all the same :
Kind regards
Nic T.
03-06-2017 3:03 AM
Dear Nic,
I have seen the the references given by you and I tried by setting multiple Properties to Worksheet to get the Tab Color.
Following Options I have tried:
‘TabColor.Rgb’ Property is used to Coloring in Open XML, Same I haveused in XML Coiding in ABAP which is not working ( Check Point no:1 ).
1. r_worksheet->set_attribute_ns( name = ‘TabColor.Rgb’ prefix = ‘ss’ Value = ‘Red’ ).
TabColor Property is used to coloring the Excel Worksheet Tab. ( Check Point no:2 ).
2. r_worksheet->set_attribute_ns( name = ‘TabColor’ prefix = ‘ss’ Value = ‘Red’ ).
‘Color’ Property, Which is Used for Coloring Excel Cell . ( Check Point no:3 ).
3. r_worksheet->set_attribute_ns( name = ‘Color’ prefix = ‘ss’ Value = ‘Red’ ).
I have recorded a Macro in Excel for tab coloring and I found ThemeColor Property used the same in abap XML Coding (Check point no:4 )
4. r_worksheet->set_attribute_ns( name = ‘ThemeColor’ prefix = ‘ss’ Value = ‘Red’ ).
But I am not getting the below expected output.
If you have any solutions/Other options, Please suggest.
Thanks & Regards,
Nagaraju Adhikari
03-06-2017 5:52 AM
My generic answer : if you want to do something on a XMLSS file, just open it in Excel, do the operation, save it, then compare the XMLSS before and after, and apply the differences in your ABAP program.