Note that there are some explanatory texts on larger screens.

plurals
  1. POWhen copying and pasting Excel data, colors are lost
    primarykey
    data
    text
    <p>At the risk of having this question downvoted into oblivion or closed as "Too Localized", I figured I would post about this issue since my boss complains constantly about it and it has me scratching my head.</p> <p>We use the <a href="http://www.infragistics.com/products/dotnet/" rel="nofollow noreferrer">Infragistics NetAdvantage</a> <a href="http://www.infragistics.com/products/aspnet/excel-exporter/" rel="nofollow noreferrer">Excel control</a> to create an Excel report on the fly. Some cells, we add a fill color like so:</p> <pre><code>sheet.Rows[i].Cells[0].CellFormat.FillPattern = FillPatternStyle.Solid; sheet.Rows[i].Cells[0].CellFormat.FillPatternForegroundColor = Color.FromArgb(127, 127, 127); </code></pre> <p>This works great and the report comes out looking fine:</p> <p><img src="https://i.stack.imgur.com/Dy6ui.png" alt="Working Image"></p> <p>However, if my manager selects all the cells in Excel, copies the data to the clipboard, then <em>pastes</em> those cells into another Excel file, all the colors are converted into some weird 3bit palette:</p> <p><img src="https://i.stack.imgur.com/2qfNw.png" alt="enter image description here"></p> <p>Now, every Fill color is either pure red (#FF0000), pure green (#00FF00), pure blue (#0000FF) or yellow (#FFFF00). It's all or nothing of any given color. That dark grey header even becomes completely white.</p> <p>One interesting thing is if I go and manually change the fill color of one of those cells in Excel, then copy and paste that, the color I manually set is copied over perfectly while the Infragistics generated cells are dithered.</p> <p>This only occurs when copying between Excel files, not between Worksheets within an Excel document. Has anyone ran into this issue, or do any Excel experts know what could cause this from a technical point of view?</p> <p>This is Excel 2007, and Infragistics Build 8.2.20082.1000.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload