2023 Sep 19 11:16 AM
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.
2023 Sep 21 7:35 AM
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.
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.
2023 Sep 19 11:33 AM
Did you check for abap2xlsx - Read and generate Excel Spreadsheets with ABAP (also in this forum)
2023 Sep 19 12:23 PM
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.
2023 Sep 20 4:39 AM
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?
2023 Sep 20 11:17 AM
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.
2023 Sep 20 11:48 AM
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.
2023 Sep 20 12:17 PM
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.
2023 Sep 21 7:35 AM
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.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |