We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Multiple colored text within an Excel cell

Thread ID:

Created:

Updated:

Platform:

Replies:

105609 Nov 5,2012 05:13 PM UTC Nov 6,2012 05:04 AM UTC WPF 1
loading
Tags: XlsIO
Phil Steel
Asked On November 5, 2012 05:13 PM UTC

Hello,

Is it possible to do multiple colored text within an Excel cell?

So if I have a cell with the value 'Employee John Smith' is it possible to make 'Employee' grey and 'John Smith' red?

Thanks,
Phil

Mahajothi R [Syncfusion]
Replied On November 6, 2012 05:04 AM UTC

Hi Phil,

 

Thank you for your interest in Syncfusion products.

 

Yes, Our XlsIO support multiple colored text within an excel cell. We have provided the sample with code snippet below for your reference.

 

Sample : RichTextString.zip

 

Code Snippet [C#]:

 

//Insert Rich Text

IRange range = worksheet.Range["C3"];

range.Text = "Employee John Smith";

IRichTextString rtf = range.RichText;

 

//Formatting the text

IFont fontGray = workbook.CreateFont();

fontGray.Size = 16;

fontGray.Bold = true;

fontGray.Italic = true;

//grey color

fontGray.RGBColor = System.Drawing.Color.FromArgb(255, 192, 192, 192);

rtf.SetFont(0, 7, fontGray);

 

IFont fontRed = workbook.CreateFont();

fontRed.Size = 12;

fontRed.Bold = false;

fontRed.Italic = false;

//red color

fontRed.RGBColor = System.Drawing.Color.FromArgb(255, 255, 0, 0);

rtf.SetFont(9, 18, fontRed);

 

Please refer XlsIO Formatting sample in Syncfusion Essential studio dashboard.

Dashboard location : $system drive:\Program Files\Syncfusion\Essential Studio\10.3.0.43\Samples\

 

To know more details on Rich Text please refer this online link : http://help.syncfusion.com/Reporting/XlsIO/WPF

 

Please let us know if you require any further clarifications.

 

Regards,

Mahajothi.


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;