When using the method object.Fill.SetPattern(...) to tried to apply some background colour to an excel file that is being created with Spreadsheetlight, an MissingMethodException is thrown, which I can't understand the reason
I tried to look up in the developer documentation for possible problems but I couldn't find the solution
using (SLDocument sl = new SLDocument())
{
sl.ImportDataTable("A1", dataTable, true);
var style = sl.CreateStyle();
style.Fill.SetPattern(PatternValues.Solid, SLThemeColorIndexValues.Accent2Color, SLThemeColorIndexValues.Accent4Color);
sl.SetCellStyle("A1:Z1", style);
sl.SaveAs(fileName);
}
I expect the first row in the excel file, range A1:Z1, to be have some background colour.
Below is the exception:
System.MissingMethodException: 'Method not found: 'Void SpreadsheetLight.SLFill.SetPattern(DocumentFormat.OpenXml.Spreadsheet.PatternValues, SpreadsheetLight.SLThemeColorIndexValues, SpreadsheetLight.SLThemeColorIndexValues)'.'
I have ran your code and don't see any errors here is what I have