Quantcast
Channel: EPPlus Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 2262

Created Unassigned: ConditionalFormat Styles: Incorrect count. [15035]

$
0
0
When generating a workbook with conditional formatting the Styles.xml file has an incorrect count againsst the dxfs node.

The following code is missing from the UpateXML method on the ExcelStyles class:

```
(dxfsNode as XmlElement).SetAttribute("count", count.ToString());
```

Would expect this to be called after appending all dxfs styles.

Note: This does not appear to cause a problem in MS Excel (the conditional formatting works fine), however if you try to view the spreadsheet in Google docs the rule is present but there is no format selected.

A workaround is to add the following code after adding conditional formatting:
```
//Fix Styles for Conditional Format
XmlNamespaceManager nsMgr = new XmlNamespaceManager(excelpack.Workbook.StylesXml.NameTable);
nsMgr.AddNamespace("ss", "http://schemas.openxmlformats.org/spreadsheetml/2006/main");

XmlNode dxfsNode = excelpack.Workbook.StylesXml.SelectSingleNode("//ss:dxfs", nsMgr);
(dxfsNode as XmlElement).SetAttribute("count", "1");
```

Viewing all articles
Browse latest Browse all 2262

Trending Articles



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