the cfm file code:

<cfinvoke component="gvs_reports" method="Needs_Report"
returnvariable="MyReport">
<cfinvokeargument name="ReportFormat" value="PDF">

</cfinvoke>

the CFC code:
<cfcomponent>
        
        <cffunction name="Needs_Query" returntype="query" output="false"
access="remote">
                <cfset var MyQuery="">
                <cfquery name="MyQuery" datasource="myDSN">

                 *** your sql goes here ****  
                </cfquery>
                <cfreturn MyQuery>
        </cffunction>
        
        <cffunction name="Needs_Report" output="true" access="remote"
returntype="any">
                <cfargument name="ReportFormat" type="string" required="yes"
hint="format type for report" />
                <cfinvoke component="gvs_reports" method="Needs_Query"
returnvariable="MyQuery"> 
                <cfreport template="../_reports/gvs_techneeds.cfr"
format="#ARGUMENTS.ReportFormat#" query="MyQuery" />
        </cffunction>
</cfcomponent>

This works fine for me, now all I have to do is pass the arguments
from FLEX to the CFC...
Craig



--- In [email protected], Scott Barnes <[EMAIL PROTECTED]> wrote:
> If you use CFCONTENT you can push the mime-type back to the browser,
> which in turn should trigger the intended result you are after.
> 
> I'm actually about to integrate FLASHPAPER with my FLEX app today, so
> umm I'll let you know if i discover anything bad/good :)
> 
> 
> 
> 
> On 5/12/05, Tarik Ahmed <[EMAIL PROTECTED]> wrote:
> > I haven't used CF7 so a blind guess is perhaps you need to add a
> > CFHEADER to the cfm file to identify the mime-type.
> > 
> > Or try it this way:
> > 
> > <cfobject component="gvs_techneeds" name="myCFC">
> > <cfoutput>#myCFC.Needs_Report("PDF")#</cfoutput>
> > 
> > Try asking this on BACFUG (www.bacfug.org), someone on there will
> > probably know (Sean Corfield and a bunch of other CF gurus are on
there).
> > 
> > cnewroth55 wrote:
> > 
> > >I understand I can easily call a cfc in a cfm file and then use the
> > >cfreport tag in the cfm file to call the template and use the query
> > >returned by the cfc for my report. However what I want to do is a bit
> > >different. I would like to have a function in my cfc that does the
> > >query and another function inside cfc that uses the query to create
> > >the report and pass a format argument like PDF or Flash or Excel
> > >Remotely using Flex (flash) Here is my CFC Code, but when i call it
> > >from a cfm file to test it. I get a blank page.
> > >
> > >What am i doing wrong?
> > >
> > >Attached CFM Code to test CFC:
> > >
> > ><cfinvoke component="gvs_techneeds" method="Needs_Report"
> > >returnvariable="MyReport" ReportFormat="PDF">
> > >
> > >
> > >
> > >Attached CFC Code
> > >
> > ><cfcomponent>
> > >        <cffunction name="Needs_Query" returntype="query" output="no"
> > >access="public">
> > >               <cfset var MyQuery="">
> > >
> > >               <cfquery name="MyQuery" datasource="ProdETT_GVS">
> > >                                               A Cool Query SQL
> > >Statement here
> > >               </cfquery>
> > >               <cfreturn MyQuery>
> > >        </cffunction>
> > >
> > >        <cffunction name="Needs_Report" returntype="any"
output="true"
> > >access="remote">
> > >               <cfargument name="ReportFormat" type="string"
> > >required="yes" hint="format type for report" />
> > >
> > >               <cfset MyReport = "">
> > >
> > >               <cfinvoke component="gvs_techneeds"
> > >method="Needs_Query" returnvariable="MyQuery">
> > >
> > >               <cfreport name="MyReport"
> > >template="../_reports/gvs_techneeds.cfr"
> > >format="#ARGUMENTS.ReportFormat#" query="MyQuery" />
> > >               <cfreturn MyReport>
> > >        </cffunction>
> > ></cfcomponent>
> > >
> > >
> > >
> > >
> > >
> > >
> > >Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > 
> > Yahoo! Groups Links
> > 
> > 
> > 
> > 
> > 
> 
> 
> -- 
> Regards,
> Scott Barnes
> http://www.mossyblog.com
> http://www.flexcoder.com (Coming Soon)




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to