Export to excel then Email

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Export to excel then Email

    I have an survey application where I want users to be able to click on a link
    and a slice of data (the survey results for that survey instance) will be
    exported to an Excel file with a unique name. But instead of returning the
    file to the user I want it to be e-mailed to a document storage application.

    If I use CFContent to create the file it's returned to the user for download.
    And CFFile is only good for text files, not Excel. How do I create this excel
    file on the server?

    reynoje Guest

  2. Similar Questions and Discussions

    1. Export to excel
      Hi, I have an aspx page with an export to excel functionality....it opens a dialog box asking the client to save/open the xls file.However this...
    2. Export Datagrid to excel
      Hi, I have written the code to export my datagrid to excel. it is working fine. But i have one issue, when ever i click on export button, it...
    3. Export Excel
      Hello, I have to change the code done by an another programmer. In fact, the code do an export to Excel with CFCONTENT. That's work but there is...
    4. How to Export to Excel?
      How can I export to a excel a datagrid? -- LUIS ESTEBAN VALENCIA MICROSOFT DCE 2. MIEMBRO ACTIVO DE ALIANZADEV
    5. Export to Excel C#
      Hi, I am having a problem exporting a Datagrid to excel in asp.net. For some reason I am getting a blank excel page. I set up in IIS the Mime for...
  3. #2

    Default Re: Export to excel then Email

    When you serve Excel-ready content to the browser, it's not really Excel; it's
    comma- or tab-delimited information. With CFCONTENT, you just tell the client
    to use Excel to open the returned stream. Using CFFILE, If you name the
    created text file with a CSV extension, most Excel users have that MIME type
    mapped to the Excel application, and should be able to open it without
    difficulty. If you're using some other voodoo to actually create a native
    Excel document for the CFCONTENT return (hard to tell because you didn't
    provide code), then I'm not sure how to proceed.

    philh Guest

  4. #3

    Default Re: Export to excel then Email

    I use something similar to this, and this forces the user to download
    the file as a Excel file (as long as they have the default MIME setting
    of Excel for CSV files)

    copied this eample from
    [url]http://www.experts-exchange.com/Web/WebDevSoftware/ColdFusion/Q_20701038.html[/url]
    Hope this helps.

    <CFSETTING ENABLECFOUTPUTONLY="yes">

    <CFSET TAB=CHR(9)>

    <CFQUERY NAME="get_Data" DATASOURCE="Deg">
    SELECT username,EMail,
    FROM Tbl_Data
    </CFQUERY>

    <CFHEADER NAME="Content-Disposition" VALUE="inline;
    filename=export.xls">
    <CFCONTENT TYPE="application/msexcel">

    <CFOUTPUT QUERY="get_Data">
    #Currentrow##TAB##username##TAB##EMail##chr(13)#
    </CFOUTPUT>

    uchil Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139