I am trying to write mailing labels to rtf format and it works great on
CF 5, however it fails in cf mx.  Word opens the file but it just looks
like plain rtf code.  Here is the part of the code I think the problem
is in.  This is the avery_rtf custom tag I am using but there is no
support for mx for it yet so I am trying to get it working on my own.
Do any of you function masters out there know if any of the mx changes
will affect this code?  Its kinda long but I am unsure what would be
throwing if off.but am pretty sure its in here somewhere.  Any help
would be greatly appreciated..thanks!      
Joe Reese
Holder Technology Group
<cfsavecontent variable="ThisTag.GeneratedRTF">
            <cfscript>
            // open RTF document with header information
            writeOutput("{\rtf1\ansi\ansicpg1252\uc1
\deff0\deflang1033\deflangfe1033{\fonttbl{\f0\fswiss Arial;}{\f1\fswiss
Helvetica;}{\f2\fswiss Impact;}{\f3\froman Times New Roman;}}");
 
writeOutput("{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\gr
een255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green
0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blu
e128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;
\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\re
d192\green192\blue192;\red255\green255\blue255;}");
            writeOutput("{\info{\title VFIVE Label Generator
(#request.rtfLabels.labeltitle# Output)}{\author cf_averyRTF $Revision:
1.17 $}{\operator cf_averyRTF resides at
http://rtf.vfive.com}{\*\company VFIVE
(http://www.vfive.com)}{\creatim\yr#Year(now())#\mo#Month(now())#\dy#Day
(now())#\hr#Hour(now())#\min#Minute(now())#}{\version1}{\edmins0}{\nofpa
ges1}{\nofwords0}{\nofchars0}{\nofcharsws0}{\vern1000}}\paperw#request.r
tfLabels.paperw#\paperh#request.rtfLabels.paperh#\margl#request.rtfLabel
s.margl#\margr#request.rtfLabels.margr#\margt#request.rtfLabels.margt#\m
argb#request.rtfLabels.margb#");
            if (Attributes.landscape)
            {
                        writeOutput("\landscape");     
            }
            writeOutput("\gutter#request.rtfLabels.gutter#
\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nosp
aceforul\horzdoc
\jexpand\viewkind1\viewscale#request.rtfLabels.viewscale#\nolnhtadjtbl
\fet0\sectd \linex#request.rtfLabels.linex#\sectdefaultcl");
            
            // loop over each row in the dataset
            for (ii = 1; ii LTE arrayLen(thisTag.assocAttribs); ii = ii
+ 1)
            {
            
                        // if this is the first cell of a row, create
the row (like <tr>)
                        if (NOT ((ii + request.rtfLabels.columns - 1)
MOD request.rtfLabels.columns))
                        {
                                    // output the <tr>-like row start,
cellBoundary
                                    writeOutput("\trowd
\trrh#request.rtfLabels.trrhcell#\trkeep" & cellBoundary);
                                    
                                    // output row setup (align, indent,
etc)
                                    writeOutput(" \pard\plain
\q#request.rtfLabels.textalign#
\li#request.rtfLabels.li#\ri#request.rtfLabels.ri#\widctlpar\intbl\faaut
o \f#request.rtfLabels.defaultfontface#\fs20\lang1033\langfe1033");
                        }
            
                        // blank line for readability
                        writeOutput("#chr(13)##chr(10)#");
                        
                        // output each individual cell header (like
<td>)
 
writeOutput("{\#request.rtfLabels.bold#\fs#request.rtfLabels.defaultfont
size#\f#request.rtfLabels.defaultfontface# ");
                        
                        // output barcode on top if appropriate
                        if (len(trim(thisTag.assocAttribs[ii].zipCode))
AND thisTag.assocAttribs[ii].barPos EQ "top")
                        {
 
writeOutput("{\field\flddirty{\*\fldinst { BARCODE
}{\lang1024\langfe1024\noproof #ThisTag.AssocAttribs[ii].zipcode#}{\\u
}}{\fldrslt }}\par");
                        }
            
                        
                        // loop over the lines of content in this cell
                        for (jj = 1; jj LTE
arrayLen(ThisTag.AssocAttribs[ii].arrCell); jj = jj + 1)
                        {
 
                                    // content to be displayed?
                                    if
(len(trim(thisTag.assocAttribs[ii].arrCell[jj].content)) OR NOT
thisTag.assocAttribs[ii].stripBlankLines)
                                    {
                                                // are we bolding this
line of content?
                                                if
(thisTag.assocAttribs[ii].arrCell[jj].bold)
                                                {
 
writeOutput("\b");
                                                }
                                                else
                                                {
 
writeOutput("\b0");
                                                }
            
                                                // include blank line to
break up actual file a bit before outputing cell's content
 
writeOutput("#chr(13)##chr(10)#");
 
writeOutput("\fs#ThisTag.AssocAttribs[ii].arrCell[jj].fs#\f#ThisTag.Asso
cAttribs[ii].arrCell[jj].f#
#ThisTag.AssocAttribs[ii].arrCell[jj].content#");
            
                                                if (jj LT
arrayLen(ThisTag.AssocAttribs[ii].arrCell))
                                                {
 
writeOutput("\par");
                                                }
                                    }
                        }
                        
                        // close out cell (like a </td>)
 
writeOutput("}{\fs#request.rtfLabels.defaultfontsize#\f#request.rtfLabel
s.defaultfontface# ");
                        
                        // output barcode on bottom if appropriate
                        if (len(trim(thisTag.assocAttribs[ii].zipCode))
AND thisTag.assocAttribs[ii].barPos EQ "bottom")
                        {
                                    writeOutput("
{\field\flddirty{\*\fldinst { BARCODE }{\lang1024\langfe1024\noproof
#ThisTag.AssocAttribs[ii].zipcode#}{\\u  }}{\fldrslt }}");
                        }
            
                        // prepare to close this cell </td>
                        writeOutput("\cell } ");
            
                        // close this cell out like a </td>
                        if (ii MOD request.rtfLabels.columns)
                        {
                                    writeOutput(" \pard
\q#request.rtfLabels.textalign#
\li#request.rtfLabels.li#\ri#request.rtfLabels.ri#\widctlpar\intbl\faaut
o {\cell }");
                        }
                        else
                        {
                                    writeOutput("\pard\plain
\q#request.rtfLabels.textalign#
\li#request.rtfLabels.li#\ri#request.rtfLabels.ri#\widctlpar\intbl\aspal
pha\aspnum\faauto\adjustright
\fs#request.rtfLabels.defaultfontsize#\f#request.rtfLabels.defaultfontfa
ce#\lang1033\langfe1033");
                        }
 
                        // if this is the last cell of a row, end it
(like a </tr>) --->
                        if (NOT (ii MOD request.rtfLabels.columns))
                        {
                                    // start close: output code +
cellCloser + " \row }"
                                    writeOutput("\pard\plain
\q#request.rtfLabels.textalign#
\li#request.rtfLabels.li#\ri#request.rtfLabels.ri#\widctlpar\intbl\aspal
pha\aspnum\faauto\adjustright
\fs#request.rtfLabels.defaultfontsize#\f#request.rtfLabels.defaultfontfa
ce#\lang1033\langfe1033 {\trowd \trrh#request.rtfLabels.trrhcell#\trkeep
" & cellCloser & " \row }#chr(13)##chr(10)#");
 
                                    // add an extra spacer row?
                                    if (request.rtfLabels.useSpacer)
                                    {
 
                                                // output complete
spacerRow as defined above                                
                                                writeOutput(spacerRow);
 
                                    }
                        }                      
            
            // end of outer for loop
            }
            
            // close out document
            writeOutput("\pard \q#request.rtfLabels.textalign#
\li#request.rtfLabels.li#\ri#request.rtfLabels.ri#\widctlpar\aspalpha\as
pnum\faauto\adjustright { \par }{ \par }}");
            </cfscript>
            </cfsavecontent>))>



______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to