|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello,
I need to schedule a batch of reports to run in ColdFusion(one per salesperson), export them to Excel, and then automatically email them as attachments to each salesperson once a week. I guess I should loop through each salesperson, create the report for that person, export to Excel and upload the file somewhere. Then I need to send it out to that recipient with CFMAIL and CFMAILPARAM. Any help on the code for this would be appreciated. Thanks, Peter ![]() |
|
#2
|
|||
|
|||
|
I'm unsure what you are looking for. CFLOOP, CFMAIL, and CFMAILPARAM are all very simple tags and their use is fully explained in the CF documentation. Obviously, you'll loop over each salesperson, build the output for the report, and use CFMAIL to format a mail message and CFMAILPARAM to attach a file to the message. I would start with that approach.
|
|
#3
|
|||
|
|||
|
Hi Kiteless,
Thanks for your response. The first thing I need to do is get this report created in Excel and saved somewhere. I've got the export to Excel part down by doing this: <CFHEADER NAME="Content-Disposition" VALUE="attachment; filename=temp.xls"><CFCONTENT TYPE="application/msexcel"> but after that, how would I go about saving this report as an excel file somewhere? Thanks again Peter |
|
#4
|
|||
|
|||
|
You could capture the output with <cfsavecontent> and then save it to disk using <cffile>. Then use <cfmailparam> to attach the file to the email. Hope that helps.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Emailing a report as attachment |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|