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

cfdocument header not supporting query results

New Here ,
Jan 29, 2008 Jan 29, 2008

Copy link to clipboard

Copied

IN CF7 I was able to use query output in the document header.

Now in CF8 when I try to use cfoutput content in the header I either get an error (when using the query variable only i.e. #var#) or if I use the #queryname.variablename# syntax I get the first records information populating the header for the entire recordset.

Example:

<cfdocument format="pdf" bookmark="yes" fontembed="no">

<cfoutput query="someQuery">

<cfdocumentsection name="#someQuery.someVar#">

<cfdocumentitem type="header">
#someQuery.somevar# <--does not work!
</cfdocumentitem>

<cfdocumentitem type="footer">
Page #cfdocument.currentpagenumber# <--This works
</cfdocumentitem>

#content#

</cfdocumentsection>
</cfoutput>
</cfdocument>
TOPICS
Advanced techniques

Views

1.2K

Translate

Translate

Report

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

correct answers 1 Correct answer

Enthusiast , Mar 06, 2008 Mar 06, 2008
Hello Eric,
I tested your example with a simple query. I am using CF8 server with "ColdFusion 8: CFDocument Cumulative Hot Fix". The latest version published the end of January. I have no other hot fix on this test server. But I would expect it to work with CHF2 or CHF3. See my attached code and try it with the CFDoc Cum Hot Fix.

You may be new to the forums and perhaps our site:
These are user forums with no regular monitoring by Adobe guaranteed. This has been the same since the Allaire days...

Votes

Translate

Translate
Explorer ,
Jan 29, 2008 Jan 29, 2008

Copy link to clipboard

Copied

It goes beyond that. I've been unable to use any scope variables in the header/footer. Not arguments, request, session, form, url nor anything else.

Votes

Translate

Translate

Report

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
Explorer ,
Jan 31, 2008 Jan 31, 2008

Copy link to clipboard

Copied

I performed some tests on this issue. Confirmed that in CF8 use in the header variable only will give us an error: "Variable myVar is undefined" not like in CF7.
If cfoutput query sorrounds <cfdocumentitem type="header"> like in your example then in both CF8 and CF8 it produces only one result.
But if you put <cfoutput query="someQuery"> within <cfdocumentitem type="header"> then in both CF versions we have all records.

Votes

Translate

Translate

Report

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 ,
Jan 31, 2008 Jan 31, 2008

Copy link to clipboard

Copied

If I use <cfoutput query="someQuery"> inside of the document header I get multiple headers inside of each page of the document.

My goal is to have a different header for each <cfdocumentsection>. This behavior works in CF7 and is documented as working in CF8. It does not.

My workaround at the moment is to create a different PDF file for each page of the document (with the correct header on each document) and use the <cfpdf action=merge> tag to join the files as one and deliver them to the browser.

This is not very efficient at all but it works. I wish Adobe would respond as this functionality is crucial to our business.

Votes

Translate

Translate

Report

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 ,
Feb 04, 2008 Feb 04, 2008

Copy link to clipboard

Copied

Unfotunately, my company was greatly affected by this CF8 bug as well. I have implemented a workaround that may work for you...

I set all of the dynamic header and/or footer variables into an array prior to creating the document. Then i reference the varibale as arrayName[cfdocument.currentpage] to pull the appropriate one. It has a minimally increased the overall document time due to looping over the same data twice, once to set the array, once to output the document, but it worked.

hope it helps.

Votes

Translate

Translate

Report

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 ,
Feb 14, 2008 Feb 14, 2008

Copy link to clipboard

Copied

Hi guys, asiciliano, that is what i was planning on doing or just referencing myquery.column[cfdocument.currentpage] but the problem is if your query does not have a 1-to-1 relationship with the number of pages for each. If you have more than one page per record then this doesnt work. Anybody have any other work arounds? Jeez has Adobe even listed this as a bug! Seems pretty serious of a problem!

Votes

Translate

Translate

Report

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 ,
Mar 06, 2008 Mar 06, 2008

Copy link to clipboard

Copied

Hey ADOBE!!!!
This is a serious issue! I posted to live docs but my post was IGNORED!

WTF???
It's been 3 weeks, can I get a response!

Votes

Translate

Translate

Report

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
Enthusiast ,
Mar 06, 2008 Mar 06, 2008

Copy link to clipboard

Copied

Hello Eric,
I tested your example with a simple query. I am using CF8 server with "ColdFusion 8: CFDocument Cumulative Hot Fix". The latest version published the end of January. I have no other hot fix on this test server. But I would expect it to work with CHF2 or CHF3. See my attached code and try it with the CFDoc Cum Hot Fix.

You may be new to the forums and perhaps our site:
These are user forums with no regular monitoring by Adobe guaranteed. This has been the same since the Allaire days.

ColdFusion 8 Hot Fixes are listed in the technote here.

Bugs can be submitted at Feature Request/Bug Report Form

The main ColdFusion Support Page is www.adobe.com/support/coldfusion/. Note there are links to updaters, hot fixes, information on support plans, etc.

Votes

Translate

Translate

Report

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 ,
Mar 07, 2008 Mar 07, 2008

Copy link to clipboard

Copied

LATEST
Thanks for the response.
I guess this hotfix wasn't included in the CHF.

I did go through the normal channels initially. I emailed support and posted in the livedocs. I received no response and my posts to livedocs weren't acknowledged. I realize that this forum is generally for users but I know Adobe does monitor it.

I've been a member here since 2002.

Votes

Translate

Translate

Report

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
Documentation