Results 1 to 2 of 2

Thread: [RESOLVED] Format columns for data intended for Excel

  1. #1
    Join Date
    Dec 2002
    St. Louis, MO, USA

    resolved [RESOLVED] Format columns for data intended for Excel

    Hello, everyone.

    I'm working on a document that runs a query, populates a <table> with the data, and then spits out an Excel sheet for the user to either open or save. I'm using the CFSCRIPT equivalent of CFCONTENT and CFHEADER to create the Excel file.

        pc = getpagecontext().getresponse();
    Everything is working great, with one exception.

    One of the query columns that is being returned is a datatype of varchar(10) - the data is a 'month year' value like "May 2010" or "Jun 2011". If you look at the data in a browser, it appears in that format ("month year"). But when the Excel file is created, it shows up as "May-12" or "Dec-12" (regardless of the month, the date is always 12.)

    I'm pretty sure this is because in Excel the column is formatted as "General" when I need it to be "Text". Is there a way to tell CF that a particular column needs to be formatted in Excel a particular way?


    Last edited by WolfShade; 11-08-2010 at 11:07 AM.

  2. #2
    Join Date
    Dec 2002
    St. Louis, MO, USA

    Thumbs up

    It isn't perfect, but it works. Depends upon how nit-picky you are regarding how the data appears.



    PS. Thanks to "cfjedimaster" at Adobe forums for this resolution.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center