在设计器中 ManualBuild方法里面添加如下代码即可实现:
private void Table1_ManualBuild(object sender, EventArgs e)
{
// initialize the data
DataSourceBase data = Report.GetDataSource("Student"); //绑定的数据表名称
// print table header
Table1.PrintRow(0);
Table1.PrintColumns();
while (data.HasMoreRows)
{
// print table body
Table1.PrintRow(1);
Table1.PrintColumns();
// go next data row
data.Next();
}
}