Skip to main content
March 20, 2009
Question

excel formatting using coldfusion/html

  • March 20, 2009
  • 2 replies
  • 1071 views
Hello Everyone,

I am currently working on exporting a query result to excel sheet....I am at loss understanding formatting excel column width. I am displaying 6 columns, but when I print I can only view 4 columns. I do not want to manually format the width in excel document. How can I do this with the help of coldfusion. I tried using width option of <td> tag but with no success. It would be great if anyone can provide suggestions on doing this...
    This topic has been closed for replies.

    2 replies

    Inspiring
    March 21, 2009
    HI,

    You should have a look at the Apache POI library to generate your Excel files from ColdFusion:
    http://poi.apache.org/spreadsheet/index.html

    The problem with just outputting HTML to Excel is that the formating of fields can be incorrect. As example if you export numbers or dates, Excel may not be able to interpret them correctly because it's accepting them as text values not true numbers or dates, in which cause you can not use formulas or filters for these values.

    cheers,
    fober

    March 21, 2009
    Hi,

    Use <td width="180">.

    cfwild