EasyCFM.COM ColdFusion Forums / ColdFusion Applications / Automatic Print Task

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Automatic Print Task

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

Liquid5118
04-13-2004 @ 1:40 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 61
Joined: Apr 2004

I'm wondering if it is possible to have coldfusion print an actual document by itself at a certain time.

For example lets say 20 new orders are entered into the database.. then at 3pm est when its time to start shipping... a printout of all the orders are automatically generated and printed.

Any ideas?

<!---- c0ldfu$i0n 0Wn$ pHp ------->

RafaelQ
04-14-2004 @ 12:18 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Junior Member
Posts: 107
Joined: Feb 2004

Here's a suggestion:

1) Create the page with a query for the new orders and dump the output to a text file (ex.. c:\orders\neworders.txt)
2) Test the page to make sure it works properly then schedule the page to run in the CFAdmin panel at the scheduled time 3pm recurring daily.
3) Create a DOS BAT file that will print the text file and save it to the orders folder.
EX (neworders.bat):
print c:\orders\neworders.txt /d:lpt1
4) Test the BAT file to make sure it prints. Then add <cfexecute> in the cfm page you made to run the BAT file.
EX:
<cfexecute name = "c:\orders\neworders.bat"
  timeout = "1">
</cfexecute>

This is off the top of my head but it should work. Also should the printer be on a network here's a link that should help with the modifying the BAT file http://support.microsoft.com/?kbid=154498.


Website Designed and Developed by Pablo Varando.