Exporting Queried Data to Excel

Discussion in 'Programming' started by Joe K, Apr 6, 2007.

  1. #1
    Hello,
    I would like to export a queried dataset to excel using a button. So far my research yielded an option that migrates to a different page. Any thoughts?

    Thanks,
    Joe
     
    Joe K, Apr 6, 2007 IP
  2. IsRoss()

    IsRoss() Peon

    Messages:
    116
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Are you using cfheader & cfcontent?

    <cfheader name="Content-Disposition" value="filename=foo.xls">

    <cfcontent type="application/msexcel">
     
    IsRoss(), Apr 6, 2007 IP
  3. Joe K

    Joe K Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I use both the cfheader and cfcontent. I managed to manipulate the output alright, I'm just curious how to incorporate that code into a button. Any thoughts? Thanks for your help so far.
     
    Joe K, Apr 6, 2007 IP
  4. datropics

    datropics Peon

    Messages:
    309
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    0
    #4
    <input type='button' value='Export to Excel' onclick="document.location.href='prepareEXcel.cfm'>

    PrepareExcel.cfm
    Carry out functions to create the file - then follow IsRoss()'s example

    Good Job IsRoss()
     
    datropics, Apr 7, 2007 IP
  5. Joe K

    Joe K Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks for your help guys.
     
    Joe K, Apr 9, 2007 IP