5 Replies Latest reply on Nov 29, 2006 8:59 AM by Like2Flex

    Query to Excel problem

    Like2Flex Level 1

      I create a cfm to export data from my query, qOrds (which comes from my cfc).

      I actually have a button in flex which, when I click, needs to export data from my query to Excel.
      My flex button calls the following function :

      My function in Flex

      public function RetrieveExcel():void
      var urll:URLRequest = new URLRequest(" http://bang:8500/dcsnew/Export2xls.cfm");



      TextHERE is my Exportt2xls.cfm

      <cfinvoke component="mycfc.cfc" method="getOrds" returnvariable="qOrds">
      <cfinvokeargument name="mydate" value="#url.mydate#">

      <CFCONTENT TYPE="application/vnd.ms-excel">
      <cfheader name="Content-Disposition" value="filename=report.xls">

      <cfquery name="exportdata" dbtype="query">
      SELECT *
      FROM qOrds


      <cfloop list="#exportdata.columnlist#" index="TDFIELD">

      <cfoutput query="exportdata">
      <cfloop list="#exportdata.columnlist#" index="COLUMNNAME">

      <cfreturn #exportdata#>

      I have a date argument that I want to pass to the cfm.
      But when am running the function, it is giving me the following error :

      "Element mydate is undefined in URL."

      Where do I need to pass the variable "mydate" in my flex code.

      Any help would be highly appreciated.