• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfschedule issues, please help

Participant ,
Jun 13, 2008 Jun 13, 2008

Copy link to clipboard

Copied

Hello;
I am trying to set up a cfschedule for part of my app. It has a number of different function, so I am trying to build them one at a time.

The first part I am trying to do it to get an export to excel to function automatically on a weekly basis, I have been writting the code, and setting it for like 5 min after I post it to see if it works, and it isn't posting a file to the directory I am specifying.

This is my code:

<cfschedule action = "run"
task = "spreadsheet"
startDate = "6/13/08"
startTime = "4:15 PM"
interval = "weekly"
resolveURL = "no"
publish = "Yes"
file = "report.xls"
path = "c:\websites\4npp8b\admin\trac\excel"
requestTimeOut = "600">

<cfsetting enablecfoutputonly="yes">

<cfquery NAME="tracking" datasource="#APPLICATION.dataSource#">
SELECT ID, REMOTE_ADDR, HTTP_USER_AGENT, TRACK_DATE, PATH_INFO
FROM tracking
ORDER BY ID
</cfquery>

<cfset tabChar = chr(9)>
<cfset newLine = chr(13) & chr(10)>

<cfcontent TYPE="application/msexcel" file="c:\websites\4npp8b\admin\trac\excel">
<cfheader name="content-disposition" value="attachment;filename=report.xls">

<cfoutput>REMOTE ADDRESS#tabChar#Browser#tabChar#Date#tabChar#Entry Page#newLine#</cfoutput>

<cfloop query="tracking">
<cfoutput>#REMOTE_ADDR##tabChar##HTTP_USER_AGENT##tabChar##TRACK_DATE##tabChar##PATH_INFO##newLine#</cfoutput>
</cfloop>
</cfschedule>

I know the excel code works, I tried it off a link before I tried to automate it, then added the file feature to the cfcontent tag.

I believe this is the way it is supposed to be done, I have been reading it from cfdocs. What am I doing wrong? Any idea? Can anyone help me fix this?

Thank you
TOPICS
Advanced techniques

Views

7.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 26, 2008 Aug 26, 2008

Copy link to clipboard

Copied

LATEST
If you use CFSCHEDULE with ACTION="RUN", the task must already be defined as a scheduled task within CF Administrator.
You would use ACTION="UPDATE" to update or create a new task.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation