Can I call a CFR in a CFC

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Can I call a CFR in a CFC

    I am understand I can easily call a cfc in a cfm file and then use the cfreport
    tag in the cfm file to call teh 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?:confused;

    <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="no" 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>

    GotJosh? Guest

  2. Similar Questions and Discussions

    1. CFC Call Hanging on Second Call
      I run the flex application localy using the demo/dev server and do a search using a CFC, and then do another and its fine. But when my boss tries,...
    2. The best way to call a cfc??
      I have read a few things about how to invoke cfc's but it just seems very tidious to develop locally then when I deploy to a development server I...
    3. call xyz.bat from ASP.net
      hi: I would like to know how to call a xyz.bat frile from ASP.net? Can it be done! Thanks amy
    4. call VBA from ASP
      Hi how a VBA macro called in ASP? Thanks. Kamram
    5. remote call procedure call failed
      Also, it says error 1726 "remote call procedure call failed" Help, Unable to save username and password in XP Home edition. It allows me to...
  3. #2

    Default Re: Can I call a CFR in a CFC

    Anyone out there?
    GotJosh? Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139