Questions about generating Excel files via CF

Posted on 2006-04-25
Last Modified: 2013-12-24

We have a client that has requested that data be sent to them in Excel format on a weekly basis.  What I would like to do is create one piece of code that I will setup through the CF administrator as a Scheduled Program to be run when they would like.  What I want this code to do is query data, generate an excel file with that data and save it to the server, then e-mail that file to our client.  I already did the research and found out how to create an excel file on the fly, so I have the code that generates and formats exactly how I want it, however I manually have to hit that cfm file so that I can get the dialog box to open/save the excel file I generated.  I also have created apps that send e-mails out, however I have never sent one via CF that had an attachment.  So I guess the 2 main things I need help with are automatically saving the generated excel file to the server, and attaching that to an e-mail I will send out via CF.

I would greatly appreciate anything that would point me in the right direction, I really don't want to manually save and attach this file on a weekly basis like I will have to do until I can get this figured out.

Thanks in advance,
Question by:sglew
    1 Comment
    LVL 35

    Accepted Solution

    You should be able to have the page save the excel file that is generated to the server, then use cfmail to send out the saved file.

    Sending the email when there is an attachment is as easy as adding the parameter

    <cfmailparam file="c:\work\filename.xls">

    in the body of the message.

    This FAQ may help:

    Auto creating/saving the excel file will use the cffile tag.  See this example tutorial:
    Building Excel Spreadsheets via XML

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
    Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now