Menu

setting font name and font size for entire sheet

Help
sumit
2015-07-13
2015-07-14
  • sumit

    sumit - 2015-07-13

    Hi,
    I am not able to set font name and font size to entire sheet using XLSLib. I am working with windows 7, using Visual Studio 2008 and I have xlsLib version 2.4.0.
    When I am using API wb.font("Calibri"); it is not showing any effect. Here WB is my workbook. I was wondering if we have setting font at the level of sheet ?

    Thanks
    Sumit

     
  • David Hoerl

    David Hoerl - 2015-07-13

    The general approach to this is to create a style with what you want - one - then apply that to each cell as you add it to the sheet. Again, you will find code examples in the test files.

     
  • sumit

    sumit - 2015-07-14

    Ok ... but can't we apply the font for a sheet as it happens in the excel file itself ?

     
  • David Hoerl

    David Hoerl - 2015-07-14

    Well, look at the header file for sheets - I don't recall that you could but I might be wrong. If not, then Excel just remembers this format and then applies it automatically to each new cell added to the sheet.

    Re-using styles is quite efficient - adding new ones to each cell causes all kinds of bad things to happen, and there have been several problems here related to people doing just that.

     

Log in to post a comment.