English 中文(简体)
ColdFusion: 如何动态地使用查询数据来弹出活周期 pdf 区块 。
原标题:ColdFusion: how to populate livecycle pdf section dynamically using query data

我有一个模板PDF PDF, 它有一个部分会像表格一样被设置。 数据会来自查询。 因此这个表格将是动态的, 数量未知 。

我如何用冷冻系统完成此任务? 它是否结合了使用 LiveCycle 创建模板, 并创建了此部分, 使其具有动态性, 然后使用 CFPDF 来传播 。

现在,我习惯于填充静态字段。

<cfpdfform source="Template.pdf"
   destination="Template2.pdf" action="populate">
   <cfpdfsubform name="form1">
    <cfpdfformparam name="pdf_controlNum" value="123">
    <cfpdfformparam name="pdf_ReportDate" value="05/01/2012">
   </cfpdfsubform>
</cfpdfform>
问题回答

我找到解决办法了,就在这个论坛上:

http://www.experts-schange.com/Software/Server_Software/Web_servers/ColdFusion/26528588.html>http://www.experts-schange.com/Software/server_Software/Web_servers/ColdFusion/26528588.html

最底线是:

2 key points 1. in cf you need to set overwritedata=”yes” in cfpdfform 2. the pdf needs to be a dynamic pdf.

希望这能帮助其他人。我没有博客,但如果你知道的话,请告诉我。确实非常方便。

<cfpdfsubform name="details">    
  <cfpdfsubform name="Table1">
    <cfloop from="1" to="#getClientOrderDetails.recordCount#" index="i">            
      <cfpdfsubform name="Row1" index = "#i#">  
      <cfpdfformparam name="pdfDescription" value="#getClientOrderDetails.ItemDescription[i]#">
        <cfpdfformparam name="pdfItemQuantity" value="#getClientOrderDetails.ItemQuantity[i]#">
        <cfpdfformparam name="pdfItemUnitPrice" value="#getClientOrderDetails.ItemUnitPrice[i]#"> 
      </cfpdfsubform>
    </cfloop> 
   </cfpdfsubform>
 </cfpdfsubform>

您只是想要创建一个 PDF 文件吗? 如果是的话, 您也需要在 Cfc 文档之后的样式表中调用 。

<cfdocument 
format="pdf" 
filename = "pdf_file_path#pdf_controlNum#_#pdf_ReportDate#.pdf"
overwrite = "yes"
marginBottom = ".2"
marginLeft = ".4"
marginRight = ".4"
marginTop = ".2">

<style type="text/css">@import "pdf.css";</style>

QUERY RESULTS TABLES AND CODING HERE ETC

</cfdocument>




相关问题
JQuery AJAX .load - flash chart doesnt load in IE

An IE issue has me completely stumped. I have a coldfusion page that uses JQuery s AJAX .load function to load in a new flash file that is generated by coldFusion s cfchart tag. This works completely ...

Best Coldfusion Library for OpenID [closed]

I am getting ready to start a project that requires using OpenID within Coldfusion 8. I have found a number of different options and was wondering what has worked the best, get s the most support, ...

Find ColdFusion Generated ID

Is there a way to find the elements generated by ColdFusion s <CFLayout> and <CFLayoutArea> tags? These tags: <cflayout type="tab" name="MyAccount"> <cflayoutarea name="...

ColdFusion COM error

I am upgrading from CF4.5 to CF8. Calls to COM dll s that used to work in version 4.5 now throw a "Complex object types cannot be converted to simple values.." error. The COM object has a few arrays ...

What s the best way to write engine-specific CFML code?

Sometimes it is necessary to write different code for Adobe ColdFusion vs Railo vs OpenBD, due to differences in implementation. Do people have a specific method that they use for this? For example, ...

热门标签