Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using External Queries

New Here ,
Aug 29, 2008 Aug 29, 2008
I've recently inherited a CF app that uses CF reports and don't have any previous experience with it.
The report appears to accept an external query, but also has an embedded query. The external query is what's being used to generate the report, but it's also processing the internal query for some reason. If I remove the internal query, it errors out. Do I need to have an internal query at all? If so, why? It seems that if I'm passing a query in using the <cfreport query attribute, I shouldn't have to embed a query in the report.
Thanks.
TOPICS
Reporting
792
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 29, 2008 Aug 29, 2008
Rufhausen wrote:
> I shouldn't have to embed a query in the report.

You don't have to, but it sounds like the previous developer choose to.

Without seeing the code I can only imagine that maybe the external query
provides one part of the data, but the internal one provides some kind
of related information.

Whether this is a good solution or just a working one would be a very
subjective matter.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 29, 2008 Aug 29, 2008
So assuming the embedded query is not used, I should be able to go to Report | Report Query and erase the query there and the report should run, yes?

The problem with doing that now is that I get a "Element SOURCE is undefined in QUERY" error even though I don't believe that the embedded query is necessary for the report.

Thanks.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 29, 2008 Aug 29, 2008
Rufhausen wrote:
> The problem with doing that now is that I get a "Element SOURCE is undefined
> in QUERY" error even though I don't believe that the embedded query is
> necessary for the report.
>

That error says to me that the report file is expecting the embedded
query even if it not obviously using it.

A possible scenario is that the original developer created the file
using an embedded query. Then modified it to use the external query
without removing the embedded.

But I would need to know what 'Source' and where it is being used.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 29, 2008 Aug 29, 2008
LATEST
I think I just realized the issue. After removing the embedded query, I needed to go into Query Builder's Advanced mode and declare the variable used by my external query in the input field at the bottom.
Still haven't found any documentation that explains that.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources