I am generating excel reports that involves several columns that are percentage data. Since the reports are for presentation purposes I want to make them look nice by formatting the percentage data with databars with solid fill. Somehow this proves to be extremely difficult as there is no direct setting in EPPlus for solid fill for databar but nevertheless I have arrived at the answer that is in this post:
Inconsistent appearance between manual and coded versions of solid databar and databar minimum value
However no matter how hard I try to edit the code for my application I only have one column that end up with solid fill with the rest being gradient. Even though I changed the node in the question to a nodelist such as below:
var cfNodes = xdoc.SelectNodes("/default:worksheet/default:conditionalFormatting/default:cfRule", nsm);
foreach(XmlNode cfNode in cfNodes)
{
cfNode.AppendChild(extLstCf);
}
and also for the worksheet elements:
var wsNodes = xdoc.SelectNodes("/default:worksheet", nsm);
foreach(XmlElement wsNode in wsNodes)
{
wsNode.AppendChild(extLstWs);
}
I also tried playing around with the xml changing the <sqref>
parameter but that still doesn't cover all my databar columns. I think there has to be something that I can change in the xml to accomplish what I want but I don't know what to look for...