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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Excel export color

Thread ID:





88054 Jul 14,2009 10:38 AM UTC Jul 17,2009 07:15 AM UTC WinForms 1
Tags: GridControl
Philip Grzegorczyk
Asked On July 14, 2009 10:38 AM UTC


i try to export my grid to Excel. But if I use the Color.fromargb() function, Excel does not show the correct Color, such as openoffice. Must I set a converter option or something else?


Rajadurai C [Syncfusion]
Replied On July 17, 2009 07:15 AM UTC

Hi Philip,

Thanks for your interest in Syncfusion Products.

The XlsIO has a color palette where it has the collection of colors holded in ExcelKnownColors enumerator. These colors are the defined colors to be displayed in the Excel Sheet. If the exported color is not in the ExcelKnownColor then it will take the closest of the RGB values which is available in it.

For Example,
If we have one color r1, g1, b1 and another color r2, g2, b2 then we evaluate difference as (r1-r2)*(r1-r2) + (g1-g2)*(g1-g2)+(b1-b2)*(b1-b2). The smaller this values is, the closer colors are. Hence the exported color is not providing the same color in the Excel as it is in the Grid if the color value supplied through FromArgb funtion not exactly matches the known color.



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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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