Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Excel mail attachment - partial Bold inside a cell

xiswanto
Active Participant
0 Likes
2,719

Hello,

I am wondering whether the requirement is possible to make partial bold in a cell (currently I'm using cl_ixml to create the excel mail attachment data), which then I used in my cl_bcs mail send. example of my expected output inside the mail attachment in a single cell:

- Today is better than Yesterday

so instead of full bold in a single cell, only certain words are in bold.

Currently, I already know how to make full bold in a single cell, but I have yet to found out how to do partial bold. From what I understand, the bold characteristic is bound to styleID, which is bound to cell, leading to my assumption that a single cell can't use more than 1 style, but who knows there actually exist other methods (so far I've not found any clue to do so).

Any insight is greatly appreciated, perhaps someone has ever encountered such case.

1 ACCEPTED SOLUTION
Read only

xiswanto
Active Participant
2,619

In case anyone looking for an answer, I'll share the end solution of what I did

-> I did not found any solution using XML method to create excel mail attachment for case multiple font type in single cell. Instead, I used the abap2xlsx method in order to create the raw data for the half bold case.

In case anyone looking for an answer, I'll share the end solution of what I did

-> I did not found any solution using XML method to create excel mail attachment for case multiple font type in single cell. Instead, I used the abap2xlsx method in order to create the raw data for the half bold case.

7 REPLIES 7
Read only

RaymondGiuseppi
Active Contributor
Read only

Sandra_Rossi
Active Contributor
2,619

Specifically, ZDEMO_EXCEL48

  " bold
  lo_style_2 = lo_excel->add_new_style( ).
  lo_style_2->font->bold = abap_true.
  ls_rtf-offset = 42.
  ls_rtf-length = 4.
  ls_rtf-font   = lo_style_2->font->get_structure( ).
  INSERT ls_rtf INTO TABLE lt_rtf.
Read only

xiswanto
Active Participant
0 Likes
2,619

Noted with thanks.

While I'm still importing abap2xlsx and will be taking a look at it later, aside from abap2xlsx, does any traditional way using xml for my concern solution even exist?

Read only

Sandra_Rossi
Active Contributor
0 Likes
2,619

If you don't want to use the traditional way of abap2xlsx ( 😉 ), you may investigate the obsolete ways which are the XML format (before XLSX used to exist) and OLE (will work only in dialog and may be slow).

I don't know the answer, but I would type an example in Excel (text with bold and italic for instance), save as XML and record an Excel VBA macro respectively for XML and OLE technologies, and I would reproduce in ABAP the XML code corresponding to the generated XML, or convert VBA code into ABAP.

Read only

xiswanto
Active Participant
2,619

I see, I didn't know that xml is considered obsolete.

In the end of the day, I'm finally transitioning my xml code into using abap2xlsx 😄 since I never realize it is actually easier using this instead of OLE or xml method to create excel. I always thought it is so hard to import the code from abap git until I look further into it.

Thanks.

Read only

Sandra_Rossi
Active Contributor
0 Likes
2,619

I don't know if I used "obsolete" correctly, but the two XML formats were designed before XLSX, and concerning information systems, many companies and people think that old is obsolete.

Read only

xiswanto
Active Participant
2,620

In case anyone looking for an answer, I'll share the end solution of what I did

-> I did not found any solution using XML method to create excel mail attachment for case multiple font type in single cell. Instead, I used the abap2xlsx method in order to create the raw data for the half bold case.