zoukankan      html  css  js  c++  java
  • FastReport打印table

    经过验证是对的。

    table第一行添加标题,也就是拖过来的文本label,第二行开始绑定数据源的字段。

    先设计报表的静态部分,再用代码注册数据源,然后设计,添加注册的数据源,绑定字段。

    1            
    2             var report = new Report();
    3             report.Load(ProTaskReport);
    4             report.RegisterData(new [] {header}, "header");
    5             report.RegisterData(body, "body");
    6             report.RegisterData(sum, "sum");
    7             //report.Design();
    8             report.Print();

    在报表内添加table的print行。

     1 private void Table2_ManualBuild(object sender, EventArgs e)
     2     {
     3       DataSourceBase body = Report.GetDataSource("sum");
     4       body.Init();
     5       Table2.PrintRow(0);
     6       Table2.PrintColumns();                       
     7       while(body.HasMoreRows){
     8         Table2.PrintRow(1);
     9         Table2.PrintColumns();
    10         body.Next();  
    11       }
    12     }

     2017-5-17 补充

    其实这样做没必要,可以将数据部分写在data body里面,绑定数据源字段即可。

  • 相关阅读:
    Orchard CMS中如何打包不带源码的模块
    牛X的CSS3
    Docker指令
    Spring Boot 应用 发布到Docker
    Haproxy全透明代理
    TCP/IP协议理解
    ubuntu tomcat 部署java web
    UDP"打洞"原理
    java多线程-线程通信
    window环境下杀死tomcat
  • 原文地址:https://www.cnblogs.com/jonney-wang/p/6844943.html
Copyright © 2011-2022 走看看