代码如下:
```c#
public partial class FastReport打印 : Form
{
public FastReport打印()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
AA aA = new AA()
{
Id = 1,
BB = true,
ListInt = new List<int>() { 1, 2, 3 },
Name = "lcwwww",
Time = DateTime.Now,
};
List<AA> aAs = new List<AA>();
// dataGridModels.Add(bill);
aAs.Add(aA);
aAs.Add(aA);
aAs.Add(aA);
Report report = new Report();
report.Load(@"aAs.frx");
report.RegisterData(aAs, "aAs");
/*
在fastreport中赋值的时候需要[] 包起来。
*/
//静默打印
//report.PrintSettings.ShowDialog = true;//选择打印机页面是否显示
//report.PrintSettings.Printer = @"\\WANGWEI-PC\Brother MFC-7380";
//report.Print();
//report.Dispose();
//预览打印
report.Show();
report.Dispose();
}
}
public class AA
{
public int Id { get; set; }
public DateTime Time { get; set; }
public string Name { get; set; }
public bool BB { get; set; }
public List<int> ListInt { get; set; }
}
```
编辑器打开后编辑要显示的东西:
几乎类似winform的页面设计。