title: CFRETURN to .CFM page
body: <p>Trying to display structExcelResult["strUrl"] created by the function on my .cfm page.</p>
  
  <pre><code>&lt;cffunction name="getBuyerReport" output="false" access="public" returntype="struct"&gt;
  &lt;cfargument name="intRegionId" required="yes"&gt;
  &lt;cfargument name="intBuyerId" required="yes"&gt;
  &lt;cfargument name="intStage" required="yes"&gt;
  &lt;cfargument name="strSortField" required="yes"&gt;
  &lt;cfargument name="strSortDirection" required="yes"&gt;
  &lt;cfset var structExcelResult = StructNew()&gt;
  &lt;cfset var qRead="" /&gt;
  
      &lt;cfquery name="qRead" datasource="#variables.dsn#"&gt;
          SELECT CONVERT(varchar,t.RECEIVED_DATE,101) AS [Received Date] 
              , t.REQUISITION_NO AS [Requisition Number]
              , t.REQUISITION_TITLE AS [Requisition Title]
              , t.TECHNICAL_AUTHORITY_NAME AS [Technical Authority]
              , bm.BID_START_DATE AS [Solicitation Date]
              , bm.BID_END_DATE AS [Closing Date]
              , CAST(t.REQ_AMOUNT AS MONEY) AS [Requisition Value]
              , CAST(t.APPROVAL_AMOUNT AS MONEY) AS [Approval Value]
              , t.CURRENT_STAGE AS [Current Stage]
              , CONVERT(varchar,t.ESTIMATED_AWARD_DATE,101) AS [Estimated Award Date]
              , replace(replace(n.NOTE,CHAR(13),''),CHAR(10),'') as [Comments]
              , DATEDIFF(day, t.RECEIVED_DATE, getdate()) AS [Age of Requisition (days)]
              , cb.USER_NAME as [Buyer Name]
              , o.OFFICE_LOCATION_NAME as [Office Location]
  
          FROM VW__TOMBSTONES__CLIENT_CODES t
              LEFT OUTER JOIN TB__OFFICE_LOCATIONS o 
                  ON o.ID = t.OFFICE__ID 
              LEFT OUTER JOIN TB__USERS cb 
                  ON t.CURRENT_BUYER__ID = cb.ID
              LEFT OUTER JOIN TB__BID_MANAGEMENTS bm 
                  ON bm.TB__TOMBSTONES__ID = t.ID
              LEFT OUTER JOIN TB__REQUISITIONS r 
                  ON r.TOMBSTONES__ID = t.ID
              LEFT OUTER JOIN TB__NOTES n 
                  ON n.REQUISITION__ID = r.ID
                  AND t.CURRENT_STAGE = n.NOTE_TYPE
  
          WHERE t.CURRENT_STAGE &lt;= 4
              AND n.NOTE_TYPE BETWEEN 1 AND 4
              AND t.REGION__ID = #arguments.intRegionId#
      &lt;/cfquery&gt;
  
  
      &lt;!--- Create new spreadsheet ---&gt;
      &lt;cfset sObj = SpreadsheetNew()&gt;
  
      &lt;!--- Excel Functions ---&gt;
      &lt;cfset countFormula="COUNTA(A8:A20000)"&gt;
      &lt;cfset sumFormula="SUM(G2:G2000)"&gt;
  
      &lt;!--- Create header row ---&gt;
      &lt;cfset SpreadsheetMergeCells(sObj,1,1,1,2)&gt;
      &lt;cfset SpreadsheetSetCellValue(sObj, "BUYER REGISTER REPORT",1,1)&gt;
      &lt;cfset SpreadsheetFormatRow(sObj, {bold=TRUE, alignment="center"}, 1)&gt;
  
      &lt;cfset SpreadsheetSetCellValue(sObj, "Report Generated Date:",3,1)&gt;
      &lt;cfset SpreadsheetFormatCell(sObj, {bold=TRUE, alignment="right"}, 3,1)&gt;
      &lt;cfset SpreadsheetSetCellValue(sObj, "#ToString(DateFormat(now(), "mmmm d yyyy"))#",3,2 )&gt;
      &lt;cfset SpreadsheetFormatCell(sObj, {bold=TRUE, alignment="left"}, 3,2)&gt;
  
      &lt;cfset SpreadsheetSetCellValue(sObj, "Number of Requisitions:",4,1)&gt;
      &lt;cfset SpreadsheetFormatCell(sObj, {bold=TRUE, alignment="right"}, 4,1)&gt;
      &lt;cfset SpreadsheetSetCellFormula(sObj,countFormula, 4, 2)&gt;
      &lt;cfset SpreadsheetFormatCell(sObj, {bold=TRUE, alignment="left"}, 4,2)&gt;
  
      &lt;cfset SpreadsheetSetCellValue(sObj, "Value of Requisitions:",5,1 )&gt;
      &lt;cfset SpreadsheetFormatCell(sObj, {bold=TRUE, alignment="right"}, 5,1)&gt;
      &lt;cfset SpreadsheetSetCellFormula(sObj,sumFormula, 5, 2)&gt;
      &lt;cfset SpreadsheetFormatCell(sObj, {bold=TRUE, alignment="left"}, 5,2)&gt;
      &lt;cfset SpreadsheetFormatCell(sObj, {dataformat="$##,##0.00"}, 5,2)&gt;
  
      &lt;cfset SpreadsheetAddRow(sObj, "" )&gt;
      &lt;cfset SpreadsheetAddRow(sObj, "RECEIVED DATE,REQUISITION NUMBER,REQUISITION TITLE,TECHNICAL AUTHORITY,SOLICITATION DATE,CLOSING DATE,REQUISITION VALUE,APPROVAL VALUE,CURRENT STAGE,ESTIMATED AWARD DATE,COMMENTS,AGE OF REQUISITION (DAYS),BUYER NAME,OFFICE LOCATION")&gt;
      &lt;cfset SpreadsheetFormatRow(sObj, {bold=TRUE}, 7)&gt;
  
      &lt;!--- Add orders from query ---&gt;
      &lt;cfset SpreadsheetAddRows(sObj, qRead)&gt;
      &lt;cfset SpreadsheetFormatColumns(sObj, {dataformat="$##,##0.00"}, "7-8")&gt;
      &lt;cfset SpreadsheetFormatColumns(sObj, {alignment="center"}, "9-10")&gt;
      &lt;cfset SpreadsheetFormatColumns(sObj, {alignment="center"}, "12-15")&gt;
  
      &lt;!--- Excel document naming and storing location ---&gt;
      &lt;cfset strDir=GetDirectoryFromPath(GetCurrentTemplatePath())&amp;"/../assets/generatedXLS/"&gt;
      &lt;cfset strFilePrepend = "-BuyerReport-" /&gt;
      &lt;cfset strFileNameStamp = "Galileo" &amp; "#strFilePrepend#" &amp; "#ToString(DateFormat(now(), "yy-mm-dd"))#" &amp; "-#ToString(TimeFormat(now(), "HHmmss"))#" &amp; ".xls"/&gt;
  
      &lt;cfspreadsheet action="write" 
          filename="#strDir##strFileNameStamp#" 
          name="sObj" 
          overwrite="true" 
          sheetname="Active (Stages 1-4)"&gt;
  
      &lt;cfset structExcelResult["strURL"] = "/web_apps/app/assets/generatedXLS/" &amp; #strFileNameStamp# /&gt;
      &lt;cfset structExcelResult["strNoRecordsFoundMsg"] = "" /&gt;
  
  &lt;cfreturn structExcelResult&gt;
  </code></pre>
  
  <p></p>
  
  <p>How do I fetch that data (structExcelResult["strURL"]) and display it on my .cfm page?</p>
  
  <p>I'm new at this and going through Ben Forta books... Thanks!</p>