Following is the code to do exactly what you want but it is for three icon set you can change it based on your icons. I'm setting red color arrow if value is greater than 4,yellow color arrow if value is between 1 and 4 and, finally, green color if...
I did it with the following code: //ExcelWorksheet ws var validation = ws.DataValidations.AddListValidation(cell.Address); validation.ShowErrorMessage = true; validation.ErrorStyle = ExcelDataValidationWarningStyle.stop; validation.ErrorTitle = "Error"; validation.Error = "Error Text"; // sheet with a name : DropDownLists // from DropDownLists sheet, get values from cells: !$A$1:$A$10 var formula = "=DropDownLists!$A$1:$A$10" validation.Formula.ExcelFormula = formula; ...
c#,export-to-excel,epplus,epplus-4
Why not to save after every batch and open existing xls & do updates & save again? Just like ExcelPackage package = new ExcelPackage(newFile); (*plese note here that newFile is only variable name, in this context, it is more like existingFile) you will NOT lost what you already have in...
Are you running EPP 4.0.1? If so, it is a known issue: https://epplus.codeplex.com/workitem/15134 Someone posted a replacement setter for the Merge property (although the getter is still incorrect it seems). When I pasted their replacement setter in ExcelRangeBase.cs and recompiled this test method started working for me: [TestMethod] public void...
I dont think EPP supports custom conditional formatting which are stored as "Workbook Extensions" in the xml of the Excel file. You could copy the xml node of the "extLst" which contains the custom formatting from one worksheet to another. Just make sure there is nothing else beside the cond...
c#,graph,bar-chart,epplus,epplus-4
I think you want to use eChartType.ColumnClustered instead of eChartType.BarClustered since Direction is meant to be set at construction (took a peak at the source code). Like this: [TestMethod] public void Vertical_Bar_Chart() { var existingFile = new FileInfo(@"c:\temp\temp.xlsx"); if (existingFile.Exists) existingFile.Delete(); using (var package = new ExcelPackage(existingFile)) { var workbook...
If the dates are stored in excel as doubles (or a whole number if there is no time component) with formatting applied, which would be the "correct" way, you have recreate the date in code and reapply the date format applied in Excel. The only wrinkle is excel's formatting is...
c#,excel,graph,epplus,epplus-4
The problem is the you are creating a new Excel Address that is NOT attached to a worksheet when setting HeaderAddress. Its a very subtle but important difference because Excel would not know which sheet the address is actually associated with when looking for the header value (it would not...