Good afternoon,
I am attempting to print out a phone listing for my company from a CF page on our intranet.
The code is below. It is NOT as bad as it looks. The gobbledygook is all the rtf codes. The part in question is the CFloop and cfQuery right after the tag, and the parameters way at the end, at the end of the second to last line: #PhoneListingReport.FirstName# #PhoneListingReport.LastName# #PhoneListingReport.extension#
When I run this page, I get the download message, and I can save it and open it. However, I only get one record, the first in the query results, instead of the 100+ that I should.
I have tried the code with and without CFLoop, since CFOUTPUT doesn't need CFLOOP, but I still only get one record output.
Anyone know why?
*****BEGIN CODE*****
<CFHEADER NAME="Content-Disposition" VALUE="attachment; filename=TestData.doc">
<cfquery name="PhoneListingReport" datasource="Intranet" dbtype="ODBC">
select firstname, lastname, extension from tblEmployee
</cfquery>
<CFCONTENT TYPE="application/rtf"><cfloop query="PhoneListingReport"><cfoutput>{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f16\froman\fcharset238\fprq2 Times New Roman CE;}{\f17\froman\fcharset204\fprq2 Times New Roman Cyr;}
{\f19\froman\fcharset161\fprq2 Times New Roman Greek;}{\f20\froman\fcharset162\fprq2 Times New Roman Tur;}{\f21\froman\fcharset186\fprq2 Times New Roman Baltic;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;
\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;
\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\widctlpar\adjustright \fs20\cgrid \snext0 Normal;}{\*\cs10 \additive Default Paragraph Font;}{\s15\widctlpar\tqc\tx4320\tqr\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext15 header;}{
\s16\widctlpar\tqc\tx4320\tqr\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext16 footer;}}{\info{\title TEST DATA}{\author Kathryn Butterly}{\operator Kathryn Butterly}{\creatim\yr2001\mo2\dy8\hr10\min25}{\revtim\yr2001\mo2\dy8\hr10\min26}{\version1}
{\edmins1}{\nofpages1}{\nofwords0}{\nofchars0}{\*\company Washington Mutual Finance}{\nofcharsws0}{\vern37}}\widowctrl\ftnbj\aenddoc\formshade\viewkind1\viewscale83\viewzk2\pgbrdrhead\pgbrdrfoot \fet0\sectd \linex0\endnhere\sectdefaultcl {\footer
\pard\plain \s16\widctlpar\tqc\tx4320\tqr\tx8640\adjustright \fs20\cgrid {\field{\*\fldinst { FILENAME\\p \\* MERGEFORMAT }}{\fldrslt }}{\field{\*\fldinst { FILENAME\\p \\* MERGEFORMAT }}{\fldrslt }}{
\par }}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}
{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8
\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \widctlpar\adjustright \fs20\cgrid {#PhoneListingReport.FirstName# #PhoneListingReport.LastName# #PhoneListingReport.extension#
\par }}</cfoutput></cfloop>
*****CODE*****
Kathryn
I am attempting to print out a phone listing for my company from a CF page on our intranet.
The code is below. It is NOT as bad as it looks. The gobbledygook is all the rtf codes. The part in question is the CFloop and cfQuery right after the tag, and the parameters way at the end, at the end of the second to last line: #PhoneListingReport.FirstName# #PhoneListingReport.LastName# #PhoneListingReport.extension#
When I run this page, I get the download message, and I can save it and open it. However, I only get one record, the first in the query results, instead of the 100+ that I should.
I have tried the code with and without CFLoop, since CFOUTPUT doesn't need CFLOOP, but I still only get one record output.
Anyone know why?
*****BEGIN CODE*****
<CFHEADER NAME="Content-Disposition" VALUE="attachment; filename=TestData.doc">
<cfquery name="PhoneListingReport" datasource="Intranet" dbtype="ODBC">
select firstname, lastname, extension from tblEmployee
</cfquery>
<CFCONTENT TYPE="application/rtf"><cfloop query="PhoneListingReport"><cfoutput>{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f16\froman\fcharset238\fprq2 Times New Roman CE;}{\f17\froman\fcharset204\fprq2 Times New Roman Cyr;}
{\f19\froman\fcharset161\fprq2 Times New Roman Greek;}{\f20\froman\fcharset162\fprq2 Times New Roman Tur;}{\f21\froman\fcharset186\fprq2 Times New Roman Baltic;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;
\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;
\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\widctlpar\adjustright \fs20\cgrid \snext0 Normal;}{\*\cs10 \additive Default Paragraph Font;}{\s15\widctlpar\tqc\tx4320\tqr\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext15 header;}{
\s16\widctlpar\tqc\tx4320\tqr\tx8640\adjustright \fs20\cgrid \sbasedon0 \snext16 footer;}}{\info{\title TEST DATA}{\author Kathryn Butterly}{\operator Kathryn Butterly}{\creatim\yr2001\mo2\dy8\hr10\min25}{\revtim\yr2001\mo2\dy8\hr10\min26}{\version1}
{\edmins1}{\nofpages1}{\nofwords0}{\nofchars0}{\*\company Washington Mutual Finance}{\nofcharsws0}{\vern37}}\widowctrl\ftnbj\aenddoc\formshade\viewkind1\viewscale83\viewzk2\pgbrdrhead\pgbrdrfoot \fet0\sectd \linex0\endnhere\sectdefaultcl {\footer
\pard\plain \s16\widctlpar\tqc\tx4320\tqr\tx8640\adjustright \fs20\cgrid {\field{\*\fldinst { FILENAME\\p \\* MERGEFORMAT }}{\fldrslt }}{\field{\*\fldinst { FILENAME\\p \\* MERGEFORMAT }}{\fldrslt }}{
\par }}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}
{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8
\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \widctlpar\adjustright \fs20\cgrid {#PhoneListingReport.FirstName# #PhoneListingReport.LastName# #PhoneListingReport.extension#
\par }}</cfoutput></cfloop>
*****CODE*****
Kathryn