using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Windows.Forms; using System.Drawing; using System.Data; using FastReport; using FastReport.Data; using FastReport.Dialog; using FastReport.Barcode; using FastReport.Table; using FastReport.Utils; namespace FastReport { public class ReportScript { private void Table1_ManualBuild(object sender, EventArgs e) { TableCell tab1=new TableCell(); tab1.HorzAlign=HorzAlign.Center; tab1.VertAlign=VertAlign.Center; tab1.FillColor=Color.LightGray; tab1.Border.Lines=BorderLines.All; tab1.Border.Color=Color.Black; tab1.Font=new Font("宋体",9); DataSourceBase data1 = Report.GetDataSource("Table1"); // 获取DataSet中表名为Table1的数据源 data1.Init(); // 初始化 Table1.PrintRow(0); // 控件Table1打印第0行 Table1.PrintColumns(); // 每打印一行,都要调用 PrintColumn或PrintColumns int index = 0; while(data1.HasMoreRows) // 打印重复循环的行 { Table1.PrintRow(1); Table1.PrintColumns(); if((++index)%2==0) { for(int i=0;i<Table1.ColumnCount;i++) { Table1.ResultTable.Rows[index][i].SetStyle(tab1); } } data1.Next(); // 读取下一行 } } private void Table6_ManualBuild(object sender, EventArgs e) { TableCell tab1=new TableCell(); tab1.HorzAlign=HorzAlign.Center; tab1.VertAlign=VertAlign.Center; tab1.FillColor=Color.LightGray; tab1.Border.Lines=BorderLines.All; tab1.Border.Color=Color.Black; tab1.Font=new Font("宋体",9); DataSourceBase data1 = Report.GetDataSource("Table2"); // 获取DataSet中表名为Table1的数据源 data1.Init(); // 初始化 Table6.PrintRow(0); // 控件Table1打印第0行 Table6.PrintColumns(); // 每打印一行,都要调用 PrintColumn或PrintColumns int index = 0; while(data1.HasMoreRows) // 打印重复循环的行 { Table6.PrintRow(1); Table6.PrintColumns(); if((++index)%2==0) { for(int i=0;i<Table6.ColumnCount;i++) { Table6.ResultTable.Rows[index][i].SetStyle(tab1); } } data1.Next(); // 读取下一行 } } private void Table7_ManualBuild(object sender, EventArgs e) { TableCell tab1=new TableCell(); tab1.HorzAlign=HorzAlign.Center; tab1.VertAlign=VertAlign.Center; tab1.FillColor=Color.LightGray; tab1.Border.Lines=BorderLines.All; tab1.Border.Color=Color.Black; tab1.Font=new Font("宋体",9); DataSourceBase data1 = Report.GetDataSource("Table3"); // 获取DataSet中表名为Table1的数据源 data1.Init(); // 初始化 Table7.PrintRow(0); // 控件Table1打印第0行 Table7.PrintColumns(); // 每打印一行,都要调用 PrintColumn或PrintColumns int index = 0; while(data1.HasMoreRows) // 打印重复循环的行 { Table7.PrintRow(1); Table7.PrintColumns(); if((++index)%2==0) { for(int i=0;i<Table7.ColumnCount;i++) { Table7.ResultTable.Rows[index][i].SetStyle(tab1); } } data1.Next(); // 读取下一行 } } private void Table4_ManualBuild(object sender, EventArgs e) { TableCell tab1=new TableCell(); tab1.HorzAlign=HorzAlign.Center; tab1.VertAlign=VertAlign.Center; tab1.FillColor=Color.LightGray; tab1.Border.Lines=BorderLines.All; tab1.Border.Color=Color.Black; tab1.Font=new Font("宋体",9); DataSourceBase data1 = Report.GetDataSource("Table5"); // 获取DataSet中表名为Table1的数据源 data1.Init(); // 初始化 Table4.PrintRow(0); // 控件Table1打印第0行 Table4.PrintColumns(); // 每打印一行,都要调用 PrintColumn或PrintColumns int index = 0; while(data1.HasMoreRows) // 打印重复循环的行 { Table4.PrintRow(1); Table4.PrintColumns(); if((++index)%2==0) { for(int i=0;i<Table4.ColumnCount;i++) { Table4.ResultTable.Rows[index][i].SetStyle(tab1); } } data1.Next(); // 读取下一行 } } private void Table5_ManualBuild(object sender, EventArgs e) { TableCell tab1=new TableCell(); tab1.HorzAlign=HorzAlign.Center; tab1.VertAlign=VertAlign.Center; tab1.FillColor=Color.LightGray; tab1.Border.Lines=BorderLines.All; tab1.Border.Color=Color.Black; tab1.Font=new Font("宋体",9); DataSourceBase data1 = Report.GetDataSource("Table4"); // 获取DataSet中表名为Table1的数据源 data1.Init(); // 初始化 Table5.PrintRow(0); // 控件Table1打印第0行 Table5.PrintColumns(); // 每打印一行,都要调用 PrintColumn或PrintColumns int index = 0; while(data1.HasMoreRows) // 打印重复循环的行 { Table5.PrintRow(1); Table5.PrintColumns(); if((++index)%2==0) { for(int i=0;i<Table5.ColumnCount;i++) { Table5.ResultTable.Rows[index][i].SetStyle(tab1); } } data1.Next(); // 读取下一行 } } } }