Skip navigation
Crazy4PDFs
Currently Being Moderated

How to create pdf to be prepopulated from SQL Table

Apr 12, 2010 1:22 PM

I am having trouble generating a PDF that will add rows depending on the amount of records in my SQL Table. For example i am trying to generate a billing report on a monthly cycle. The data which i have in the table is for a certain client with a date range from 01/01/2010 - 01/31/2010. I need the table to gennerate rows for 15 different days and all i seem to get is the last record. Here is my Coldfusion Code

 

<cfquery name="qBilling" datasource="PrintBilling">
    SELECT *
    From BillingRecord
</cfquery>

 

    <cfoutput>
        <cfpdfform action="populate" source="billing.PDF">
            <cfpdfsubform name="Table1">
                <cfpdfsubform name="Row1">
  <cfloop query="qBilling">
       
           
                        <cfpdfformparam name="Batch" value="#qBilling.batch#" index="1">
                        <cfpdfformparam name="Batch" value="#qBilling.batch#" index="2">
                        <cfpdfformparam name="Date" value="#DateFormat(qBilling.date,"mm/dd/yy")#">
                        <cfpdfformparam name="DateRange1" value="#DateFormat(Now(),"mm/dd/yy")#"> 
                        <cfpdfformparam name="DateRange2" value="#DateFormat(Now(),"mm/dd/yy")#">
                        <cfpdfformparam name="Documents" value="33333">
                        <cfpdfformparam name="PBcount" value="1252">
                        <cfpdfformparam name="PBpostage" value="999">
                        <cfpdfformparam name="Paper" value="5555">
                        <cfpdfformparam name="Price" value="1900">
                        <cfpdfformparam name="Rate" value="3.42">
                        <cfpdfformparam name="Type" value="SASAS-SS">
             
           
  </cfloop>
                </cfpdfsubform>

 

            </cfpdfsubform>

 

        </cfpdfform>
    </cfoutput>

 

 

The PDF itself is saved as a Static Form only because thats what ive seen as the common problem.

 

 

Any help at all would be VERY much appreciated.

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points