Skip to main content
February 28, 2011
Answered

CFSpreadSheet, Any way to format Cell Size

  • February 28, 2011
  • 2 replies
  • 1713 views

I am using CFSpreadsheet(write) to create an Excel file.  Using SPREADSHEETFORMATROW, I didn't see any attributes to set the cell size(Length or width).  Any way to format the cell size for the entire file.

Thanks

    This topic has been closed for replies.
    Correct answer mack_

    As far as I know you need to do it for each column. But you can write

    a wrapper function to set the widths something that could be called

    like this setSpreadsheetColumnWidths(spreadsheet, "10,10,20,30,,10")

    --

    Mack

    2 replies

    Participating Frequently
    March 1, 2011

    Unless I'm mistaken, SpreadsheetSetColumnWidth should help you.

    --

    Mack

    March 1, 2011

    Thanks.  This is helpful, but I wanted to set

    the width for the entire workbook.  Is their another function to

    do that, or do I have to set each individual column.

    March 1, 2011

    As far as I know you need to do it for each column. But you can write

    a wrapper function to set the widths something that could be called

    like this setSpreadsheetColumnWidths(spreadsheet, "10,10,20,30,,10")

    --

    Mack


    Thanks for the help.


    Inspiring
    March 1, 2011

    Wow.  I had a look at this thinking "well surely it's just a matter of... well... OK that doesn't work, but one must be able to... or.. aha!... no.  Damn".  So probably much the same investigation you did.

    I'm pretty sure CF's implementation of XLS support is based on POI, and POI has a setColumnWith() method, but the object that CF exposes as a worksheet is not actually a POI object but some CF wrapper of it, so the method doesn't work.

    If it is as it seems, and CF doesn't support this sort of thing... wow, what a fvck up.  Setting column width is not exactly an edge case!

    Hopefully we're both wrong.

    Maybe ignore CF and use POI for this directly?

    --

    Adam