
Regards,
Brian
8 Answers, 1 is accepted
Exporting cells containing HTML is not supported, as mentioned in the documentation. I would recommend checking this example, illustrating a possible workaround using the excelExport event.
Regards,
Alexander Popov
Telerik

Thanks for the reply. This was helpful. I still haven't figured out a way to only bold part of a value, but I'll keep looking.
Regards,
Brian

Hi, quick question, is the above still not supported?
we have the same situation. there are cells with html tags that are showing nicely in grid but for Excel export we have to remove the tags. except that user needs to see part of the cell's text in bold.
Regards,
Frank J.
This can be achieved using custom logic on the excelExport event as suggested.
We have new examples for taking only the text from the HTML tags. It is for the footer template, but the same approach is valid for the cells as well:
https://docs.telerik.com/kendo-ui/knowledge-base/export-only-the-text-from-the-grid-cell-which-contains-html
Also, the bold style can be added using the custom styles:
https://docs.telerik.com/kendo-ui/framework/excel/appearance#configuration-options
I hope this is helpful.
Regards,
Stefan
Progress Telerik

https://docs.telerik.com/kendo-ui/knowledge-base/export-only-the-text-from-the-grid-cell-which-contains-html
Hi,
I also have the same issue, my grid display paragraph content with html tags. if part of paragraph bold, it display correctly in grid and also in export PDF. but not in export excel.
{ field: "UnitPrice", title: "Price", template: '<b>Price</b>: #: kendo.format("{0:c}", UnitPrice)#' }
the above link only give the template value. even, if i bold the Price text, it display correctly with bold in grid but in export excel , it display as <b>Price:</b>.
Hi, John,
The article that you reference shows how to remove arbitrary HTML from the XML which could otherwise break it. It seems that you would like to do the opposite - show the column in the excel file as bold text, please correct me if I am wrong.
To better understand what goes on - the grid is a UI component which visualizes the data in its data source. The excel export does a similar thing - it exports the underlying data, it does not process arbitrary content in templates:
The formats that are used in the workbook, follow the Microsoft formats and I did not find a way to include bold text within it:
https://support.office.com/en-us/article/number-format-codes-5026bbd6-04bc-48cd-bf33-80f18b4eae68
You could use the excelExport event to add another Column and make the Price text bold by using the sheets.rows.cells.bold property or you could bold the entire value:
https://dojo.telerik.com/@bubblemaster/EkOSOdix/2
excelExport: function(e) {
var sheet = e.workbook.sheets[0];
for (var i = 1; i < sheet.rows.length; i++) {
var row = sheet.rows[i];
row.cells[1].format = ' " Price" $0.00;'
row.cells[1].bold = true;
}
}
Let me know in case you have further questions.
Kind Regards,
Alex Hajigeorgieva
Progress Telerik

Hi,
Thanks for the reply.
But the cells.bold property is bold the entire cell content.
But we dont need that. For example, my cell contains line like below:
"Oats’ momentum in Greece is bold and growing. Today, thanks to Quaker’s strong brand and consistent strategy, many new products entering the market contain oats and try to communicate vocally on the goodness of oats."
Here, I want to bold the text Oats and Quakers in gird and also in export excel.
so my content would be as below
"<b>Oats’<b> momentum in Greece is bold and growing. Today, thanks to <b>Quaker’s</b> strong brand and consistent strategy, many new products entering the market contain oats and try to communicate vocally on the goodness of oats."
This displaying correctly with bold property in grid as below
"Oats’ momentum in Greece is bold and growing. Today, thanks to Quaker’s strong brand and consistent strategy, many new products entering the market contain oats and try to communicate vocally on the goodness of oats."
but in excel, it display as below
"<b>Oats’<b> momentum in Greece is bold and growing. Today, thanks to <b>Quaker’s</b> strong brand and consistent strategy, many new products entering the market contain oats and try to communicate vocally on the goodness of oats.".
So I want in excel how it is in grid. could you please provide any solution for this?
Hi, John,
I understand the requirement is to bold part of the cell but I did not find a way that Microsoft Excel have allowed for this to be configured:
https://support.office.com/en-us/article/number-format-codes-5026bbd6-04bc-48cd-bf33-80f18b4eae68
The format of the cell is proprietary to the Excel cell and it is Excel that interprets how to show the cell. If you can find a way to do that with Excel custom numeric formatting - i.e bold part of the cell, then that should be used to pass to the Kendo UI Workbook cell.
If Microsoft did not implement such conditional custom formatting, then the alternative would be to insert a separate column with the bold text and next to it have the regular text:
Here is a test example for your reference:
https://dojo.telerik.com/EMeKetEr/2
Kind Regards,
Alex Hajigeorgieva
Progress Telerik