FastReport 循环打印表格数据

1,在UI上拖放一个表格控件

2.设置表格头部信息,需要显示的数据以及边框颜色

3.选中表格控件设置事件代码:

    private void Table1_ManualBuild(object sender, EventArgs e)
    {
      // get the data source by its name
      DataSourceBase rowData = Report.GetDataSource("DETAILDATA");
      // init the data source
      rowData.Init();
      
      // print the first table row - it is a header
      Table1.PrintRow(0);
      // each PrintRow call must be followed by either PrintColumn or PrintColumns call
      // to print cells on the row
      Table1.PrintColumns();
      
      // now enumerate the data source and print the table body
      while (rowData.HasMoreRows)
      {
        // print the table body  
        Table1.PrintRow(1);
        Table1.PrintColumns();
        
        // go next data source row
        rowData.Next();
      }
      
      // print the last table row - it is a footer
      Table1.PrintRow(2);
      Table1.PrintColumns();
    }

 4.预览数据

 

 

 

22

2

 

转载于:https://www.cnblogs.com/LittleFeiHu/p/9824212.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值