Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFSpreadSheet, Any way to format Cell Size

Guest
Feb 28, 2011 Feb 28, 2011

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

1.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Mar 01, 2011 Mar 01, 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

Translate
LEGEND ,
Mar 01, 2011 Mar 01, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 01, 2011 Mar 01, 2011

Unless I'm mistaken, SpreadsheetSetColumnWidth should help you.

--

Mack

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 01, 2011 Mar 01, 2011

Hahaha: oops.

What makes it worse, is I actually checked the docs for that.

Groan.

I'd say "well spotted" if it wasn't so painfully obvious.

--

Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 01, 2011 Mar 01, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 01, 2011 Mar 01, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 01, 2011 Mar 01, 2011
LATEST

Thanks for the help.


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources