StandardFontSize

Setting the StandardFontSize property of a workbook appears to multiply the set value by 20, as the following code illustrates. ======================================= ExcelEngine eng = new ExcelEngine(); IApplication app = eng.Excel; IWorkbook xl = app.Workbooks.Create(1); IWorksheet sht = xl.Worksheets[0]; string standardFont = "Tahoma"; double standardFontSize = 8; xl.StandardFont = standardFont; xl.StandardFontSize = standardFontSize; sht[1,1].Text = "The StandardFontSize is: " + xl.StandardFontSize.ToString(); xl.SaveAs(@"C:\test.xls"); ======================================= Am I doing something wrong? I am using v2.1.0.9 Thanks- James

1 Reply

AD Administrator Syncfusion Team October 6, 2004 04:38 PM UTC

Hi James, This has been identified as a bug and will be fixed at the earliest. You can edit the normal style to get the desired effect xl.Styles["Normal"].Font.Size = 8; xl.Styles["Normal"].Font.FontName = "Tahoma"; Please let me know if you have any questions. Sorry for the inconvenience. Thanks. Best regards, Stephen. >Setting the StandardFontSize property of a workbook appears to multiply the set value by 20, as the following code illustrates. > >======================================= >ExcelEngine eng = new ExcelEngine(); >IApplication app = eng.Excel; > >IWorkbook xl = app.Workbooks.Create(1); >IWorksheet sht = xl.Worksheets[0]; > >string standardFont = "Tahoma"; >double standardFontSize = 8; > >xl.StandardFont = standardFont; >xl.StandardFontSize = standardFontSize; > >sht[1,1].Text = "The StandardFontSize is: " + xl.StandardFontSize.ToString(); > >xl.SaveAs(@"C:\test.xls"); >======================================= > >Am I doing something wrong? > >I am using v2.1.0.9 > >Thanks- > >James

Loader.
Up arrow icon