Questions about generating Excel files via CF

Posted on 2006-04-25
Medium Priority
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

mrichmon earned 750 total points
ID: 16539256
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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
What You Need to Know when Searching for a Webhost Provider
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses
Course of the Month14 days, 11 hours left to enroll

839 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