Questions about generating Excel files via CF


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,
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.