Closed Drei-Jahoda closed 2 months ago
I haven't been able to reproduce your problem, and the test results are normal here. But it should be pointed out that in the end you should use close()
instead of finish()
ok, I have update. 2 issues:
second issue is related to lib, font is overridden to Calibri when additional style is set. File checked with office 365
Workbook newWb = new Workbook(fileOutputStream, "Test", "1.0");
Worksheet sheet = newWb.newWorksheet("test sheet");
newWb.setGlobalDefaultFont("Arial", 15.5);
sheet.value(0, 0, "should be arial"); // but it is Calibri
sheet.style(0,0).fontColor(Color.RED).set();
sheet.value(2, 0, "no additional style"); // Arial 15.5 as global default
sheet.value(3,0,"manual arial with style");
sheet.style(3, 0).fontName("Arial").fontColor(Color.GREEN).set(); // Arial 11
newWb.close();
Many thanks for double check it from your side in advance.
Thanks for the feedback, the source of the problem has been identified. I plan to work on this in my spare time, hopefully not too long.
I am facing issue with setting default font name. Following example ignoring font name and also font size.
` org.dhatim.fastexcel.Workbook newWb = new org.dhatim.fastexcel.Workbook(fileOutputStream, "Test", "1.0"); Worksheet sheet = newWb.newWorksheet("test sheet");
newWb.setGlobalDefaultFont("Arial",20); // this is not working
sheet.value(0, 0, "should be arial but it is not"); sheet.value(0, 1, "arial with manual set"); sheet.style(0, 1).fontName("Arial").set();
newWb.finish();
`
Any suggestion?