-
Notifications
You must be signed in to change notification settings - Fork 812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot Set Header FontColor Of Table To Black #689
Comments
I can't reproduce this problem. Can you try with the latest CI build at https://ci.appveyor.com/project/Pyropace/ClosedXML/branch/develop/artifacts ? |
Sidenote: you can significantly reduce your code by using the internal class Data
{
public int Property1 { get; set; }
public int Property2 { get; set; }
public int Property3 { get; set; }
public int Property4 { get; set; }
public int Property5 { get; set; }
}
internal class Program
{
private static List<Data> GenerateData()
{
List<Data> list = new List<Data>();
Random r = new Random();
for (int i = 0; i < 15; i++)
{
list.Add(new Data { Property1 = r.Next(0, 100), Property2 = r.Next(0, 100), Property3 = r.Next(0, 100), Property4 = r.Next(0, 100), Property5 = r.Next(0, 100) });
}
return list;
}
private static void Main(string[] args)
{
var data = GenerateData();
var path = "test.xlsx";
using (var workbook = new XLWorkbook(XLEventTracking.Disabled))
{
var table = workbook.AddWorksheet("Sheet1").FirstCell().InsertTable(data);
using (var rangeRow = table.HeadersRow())
{
rangeRow.Style.Font.FontColor = XLColor.Blue;
rangeRow.Style.Fill.BackgroundColor = XLColor.NoColor;
}
workbook.SaveAs(path);
}
}
} |
I still have the same problem, even with the latest CI build (see attached files). I'm using the "long" way because in the actual application the properties have to be exported in a special order and some may get concatenated with others (this structure is defined in an XML file). So I can't use EDIT: I might use |
Ok, can you run my code sample as is and attach the output file that it generates? |
PS: Thanks for the good code sample. It makes it a lot easier, even though I can't replicate the problem... yet. |
Your sample (looks good): test.xlsx |
also tested with setting the |
I have the exact same behaviour. |
You could try |
This works, it sets the FontColor to Black (as expected). |
Can this be closed? |
Yes, it's not a bug in ClosedXML. |
Do you want to request a feature or report a bug?
Version of ClosedXML
0.91.0
What is the current behavior?
I have some data which are displayed as a standard table. If I want to set the FontColor of the Table's Header to Black the FontColor is still white. If I set the color to almost black (
#FF010101
) or some other color (e.g.XLColor.Red
) it works as expected.What is the expected behavior or new feature?
The FontColor of the Table's Header should be black.
Did this work in previous versions of our tool? Which versions?
No
Reproducibility
Code to reproduce problem:
The text was updated successfully, but these errors were encountered: