With the following code from two cfc files, how do I pass the result from
getAllAsStruct in CustomerGateway.cfc to exportToExcel, #arguments.data#, in
Export.cfc?
My environment is set up for using session variables. I need to cfset
session.exportData somewhere so that it can be called?
How do I hook them up so that the getAllAsStruct array is available as
#arguments.data#.
Export.cfc
<cfcomponent>
<cffunction name="exportToExcel" access="remote" returntype="boolean"
output="true">
<cfargument name="data" type="string" required="yes" default="" />
<cfset session.exportData = #arguments.data#>
<cflog text="data to be exported: #session.exportData#"/>
<cfreturn true>
</cffunction>
</cfcomponent>
CustomerGateway.cfc
<cffunction name="getAllAsStruct" output="false" access="remote"
returntype="array">
<cfset var qRead="">
<cfset var aRead = []/>
<cfset var sRead = {}/>
<cfquery name="qRead" datasource="#application.dsn#">
select *
from sav_customer
</cfquery>
<cfloop query="qRead">
<cfset sRead = {}/>
<cfset sRead["__type__"] = "stardust.cfc.Contact"/>
<cfset sRead["id_rssd"] = qRead.id_rssd/>
<cfset sRead["ctct_id"] = qRead.ctct_id/>
<cfset sRead["ser_id"] = qRead.ser_id/>
<cfset sRead["inst_nm"] = qRead.inst_nm/>
<cfset sRead["ctct_fst_nm"] = qRead.ctct_fst_nm/>
<cfset sRead["ctct_lst_nm"] = qRead.ctct_lst_nm/>
<cfset sRead["updt_dt"] = qRead.updt_dt/>
<cfset arrayAppend(aRead, sRead)/>
</cfloop>
<cfreturn aRead>
</cffunction>
I am learning yet...
Thank you for your help.
Faye Larson
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340575
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm