troubleshooting Question

How to make cfdocument load pdf faster?

Avatar of dawes4000
dawes4000Flag for United States of America asked on
ColdFusion Language
5 Comments1 Solution1036 ViewsLast Modified:
The rendering of <cfdocument format="pdf"> takes FOREVER.
I have tried using a progressbar and <cfflush> but the document just doesn't render fast enough.
Any suggestions?
<!--- Code Begins --->
<cfquery name="qryClassDetail" datasource="#session.connString#">
SELECT     tblParts.PartID, tblParts.Description, tblParts.Price, tblParts.Unitofmeasure, tblParts.resale, tblParts.NetPricing, tblClass.class AS Class,
                      tblClass.Description AS classDescription
FROM         tblParts INNER JOIN
                      tblClass ON tblParts.class = tblClass.class
WHERE     (tblParts.resale = 'y')  AND (tblParts.Price <> '0') AND (tblParts.PartID NOT LIKE '%BLANK%')  AND (tblParts.class NOT LIKE '%2') AND (tblParts.class <> 'DBME') AND (tblParts.class <> 'ELE') AND
                      (tblParts.class <> 'RMB') AND (tblParts.class <> 'SCC') AND (tblParts.class <> 'TP') AND (tblParts.class <> 'MISC') AND (tblParts.class <> 'M&C')
GROUP BY tblClass.class, tblParts.PartID, tblParts.Description, tblParts.Price, tblParts.Unitofmeasure, tblParts.resale, tblParts.NetPricing,
                      tblClass.Description
ORDER BY tblClass.class
</cfquery>

<body bgcolor="#FFFFFF" leftmargin="65">
<h3>Please Wait</h3><br>
The pages are loading...<br>
<img name="meter" width="200" height="16" src="../images/progressbar/PercentBlank.gif" border="0" alt="">
<cfflush>
<cfloop from="0" to="100" step="25" index="i">
<cfdocument format="pdf">
<table cellpadding="1" cellspacing="0" border="0" width="620">
<cfoutput query="qryClassDetail" group="Class">
      <tr><td colspan="4">&nbsp;</td></tr>
      <tr bgcolor="##4E8FD1">
            <td colspan="4"><font color="##F2F2F2"><h3>&nbsp;&nbsp;#classDescription#</h3></font></td>
      </tr>
      <tr bgcolor="##CCCCCC">
            <td width="140"><strong> Image</strong></td>
            <td width="100"><strong>PartID</strong></td>
            <td width="328"><strong>Description</strong></td>
            <td align="center" width="52"><strong>Retail</strong></td>
      </tr>
      <cfoutput>
            <cfif qryClassDetail.resale NEQ "n">
                  <cfset PartID = trim(qryClassDetail.PartID)>
                  <cfset netPrice=qryClassDetail.netPricing>
                        <tr>
                              <td align="left">
                                    <img height="40" src="../images/parts/#trim(PartID)#.jpg" border="0">
                              </td>                        
                              <td>&nbsp;#PartID#</font></td>
                              <td>
                                    &nbsp;#qryClassDetail.Description# (#trim(qryClassDetail.UnitofMeasure)#)                        
                              </td>
                              <td align="right">
                                    #NumberFormat(qryClassDetail.price,'______.__')# &nbsp;
                                    <cfif netPrice EQ "n">
                                          <br />
                                          <font style="text-align:right">(net)</font>&nbsp;
                                    </cfif>
                              </td>
                        </tr>                                                            
            </cfif>
      </cfoutput>
</cfoutput>
</table>
</cfdocument>
<cfoutput>
<script language="javascript">
document.images["meter"].src = '../images/progressbar/Percent#i#.gif';
</script>
</cfoutput>
<cfflush>
</cfloop>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros