最简fastreport打印代码
//需要引用三个文件
//D:\Patch\FastReport.dll
//D:\Patch\FastReport.Bars.dll
//D:\Patch\FastReport.Editor.dll
设计器中文语言包文件 Chinese (Simplified).frl
private void 打印()
{
List<MyEntity> entities = new List<MyEntity>
{
new MyEntity { Name = "张三", Age = 20 },
new MyEntity { Name = "李四", Age = 25 }
};
Report report = new Report();
if (File.Exists("YourReport.frx"))
{
report.Load("YourReport.frx"); // 加载报表文件
}
report.RegisterData(entities, "Entities"); // 注册数据
report.Design(); // 显示报表
}
class MyEntity
{
public string Name { get; set; }
public int Age { get; set; }
}

浙公网安备 33010602011771号