Quantcast
Channel: Open XML Format SDK forum
Viewing all articles
Browse latest Browse all 1288

Spreadsheet cells do not use correct Fill definition

$
0
0
I am creating an Excel spreadsheet for Office 2010.   Note, I am using the SAX method as the amount of data will be very large.   I am having a problem will Fill objects.   I have defined two:

fills = new Fills();

// FillID 0.

fill = new Fill();
fill.PatternFill = new PatternFill();
fill.PatternFill.PatternType = PatternValues.None;
fills.Append(fill);

// FillID 1.

fill = new Fill();
fill.PatternFill = new PatternFill();
fill.PatternFill.PatternType = PatternValues.Solid;
fill.PatternFill.ForegroundColor = TranslateForeground(SD.Color.Green);
fill.PatternFill.BackgroundColor = TranslateBackground(SD.Color.Magenta);
fills.Append(fill);
fills.Count = (UInt32) fills.ChildElements.Count;

However, I don't get this kind of fill.   When I use a FillId of 1 on any of the CellFormats all I get is a black and white grid pattern.   I can change PatternType of to any value, including None, and I will still get a black and white grid pattern.   Any thoughts or ideas?  

All the FontIds and NumberFormatIds work as expected, but the FillId will not result in the correct fill style in the Excel spreadsheet.   The Excel file opens without error.   Its just that the cells are not filled correctly.   When I save the Excel file as an XML file, all of the fill specifications (<Interior> node) look like this, regardless of the specification I have coded:

   <Style ss:ID="s15">
    <Font ss:FontName="Calibri" ss:Size="11"/>
    <Interior ss:Color="#FFFFFF" ss:Pattern="Gray125" ss:PatternColor="#000000"/>
   </Style>

Viewing all articles
Browse latest Browse all 1288

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>