Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
350
IgxGrid Cell with multiple colors
posted

Hi everyone,

I have a problem with the exporting of certain cells in my igx-grid.

Inside some cells I display a string that can consist of three numbers divided by a slash. In my app I colored the first number blue, the second green and the third black. So for the table in the app everything works as expected.

But when I export the data of this igx-grid, the export also includes this style information. In the excel file it looks like this:

Is there any way I can configure the export to not include the html-tags, or do I have to change the content of my cells in the table?

In my excel file I just want the text "250 / 255 / -" to be displayed in the cell without the style information.

If you need further information, please let me know.

Thanks in advance.

Regards

Michael

Parents
  • 40
    Verified Answer
    Offline posted

    Hello Michael Dahm,

    I have been looking into your question and prepared a small sample trying to reproduce the described behavior. Since by design, the IgxExcelExporterService is exporting the cell's value, my assumption is that you store the value as html string and after evaluating it in order to display the styling as required. In order to replicate the issue I have a field in the data source  named 'PostalCode' which value is html string. In this scenario, the default behavior when the data is exported is to display the html string without evaluating it in the excel file, so in order to modify the exported value an approach I could suggest is to handle the IgxExcelExporterService rowExporting  event and format the value using regex. Here could be found my sample for your reference.

    Please test it on your side and let me know how it behaves. If this is not an accurate demonstration of what you are trying to achieve please feel free to modify it and send it back to me along with steps to reproduce. Having a working sample on my side, which I can debug, is going to be very helpful in finding the root cause of this behavior.

    Thank you for your cooperation.
    Looking forward to hearing from you.

    Sincerely,

    Veselin Georgiev

    Entry Level Software Developer

Reply Children