Coldfusion 9及CF Roport Builder简单建立报表的多例

Coldfusin在报表使用上补充JAVA体系在报表方面的不足,俺系统为

 Window 7;ColdFusion 9 ;IIS 7;ColdFusion Report Builder;ColdFusion Builder;Crystal Report 9;MS SQL 2008 R2

 

安装 ColdFusion 9 ;ColdFusion Report Builder;ColdFusion Builder等略;

将ColdFusion 9 使用 IIS作为 Web Server,设置略;

 

俺还没将ColdFusion 9配上Tomcat

 

1. 设置Coldfusion report builder

   使用CF的RDS,需要设置RDS连接器
local view of webroot:C:/inetpub/wwwroot/CF01/
URL of Webroot:http://localhost:8100/cf01/

 

 

2. 设计报表及预览

使用报表设计向导,类似Crystal Report,设计后可以预览

 

 


3. Web浏览,使用 <CFREPORT>显示报表

   在CF Builder新建Project,新建.cfm文件,命名为welcome.cfm,添加如下语句

 

      <CFREPORT format="PDF" template="cfr01.cfr">
      </CFREPORT>

 

 

4. Web浏览,使用 动态查询,<CFREPORT>显示报表

 

<cfquery name="northwindemployees" datasource="MSSQL2008R2">
  SELECT  TOP 30  id, Yuanbianhao, shebeimingcheng, shebeipinpai, shebeishuliang
  FROM      dbo.Weixiu2
</cfquery>
 
<CFREPORT format="PDF" template="cfr01.cfr" 
    query="#northwindemployees#"/>


 

 

 

5. 使用<cfoutput>标签输出报表
<cfdocument format="flashpaper">
            <h1>Employee List</h1>
            <!--- Inline query used for example purposes only. --->
              <cfquery name="EmpList" datasource="MSSQL2008R2">
                  SELECT  TOP 30  id, Yuanbianhao, shebeimingcheng, shebeipinpai
                  FROM dbo.Weixiu2
              </cfquery>
            <cfoutput query="EmpList">
               #EmpList.id#, #EmpList.Yuanbianhao#, #EmpList.shebeimingcheng#,
               #EmpList.shebeipinpai#<br>
            </cfoutput>
     </cfdocument>

 

 

 

6. 水晶报表
   When running on Windows, the cfreport tag also supports the execution of reports created using Crystal Reports version 9 or 10.(Adobe 官方)
  
   运行环境:Windows Xp sp3; Crystal Report 9;IIS5.1; Coldfusion 9
     

   <cfreport report="CR01.rpt">
   </cfreport>

 

 


7. 使用参数动态查询

 

 

 


编写.cfm文件

<cfreport template="cfr01.cfr" format="flashpaper">
   <cfreportparam name="paraid" value="8">
</cfreport>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值