Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <cffunction name="export_do" returntype="void" output="false">
- <cfargument name="event" required="true">
- <cfheader name="Content-disposition" value="attachment;filename=leads_export.csv" />
- <cfscript>
- var rc = event.getCollection();
- var modelObj = getModel('config');
- var temp = StructNew();
- param name="rc.dealerid" default="0";
- param name="rc.leadstatusid" default="0";
- param name="rc.fromDate" default="#DateFormat('1/1/#Year(Now())#', 'mm/dd/yyyy')#";
- param name="rc.toDate" default="#DateFormat(Now(), 'mm/dd/yyyy')#";
- temp = modelObj.leadExport(dealerid=rc.dealerid, leadstatusid=rc.leadstatusid, fromdate=rc.fromdate, todate=rc.todate);
- </cfscript>
- <cfspreadsheet action="write" filename="#expandPath('.')#/export/leads_export.csv" overwrite="true" query="temp.export" sheetname="sheet1" />
- <cfscript>
- setNextEvent('config.export');
- </cfscript>
- </cffunction>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement