namespace HStation.WinFrmUI
|
{
|
public partial class XtraForm1 : DevExpress.XtraEditors.XtraForm
|
{
|
public XtraForm1()
|
{
|
InitializeComponent();
|
this.Load += Form1_Load;
|
}
|
|
public void SetBindingData(SimulationPrintViewModel viewModel)
|
{
|
XtraReport1 report = new XtraReport1();
|
report.SetBingdingData(viewModel);
|
// 生成报表文档
|
report.CreateDocument();
|
|
// 将报表文档加载到 DocumentViewer 中
|
documentViewer1.DocumentSource = report;
|
}
|
|
private void Form1_Load(object sender, EventArgs e)
|
{
|
XtraReport1 report = new XtraReport1();
|
// 生成报表文档
|
report.CreateDocument();
|
|
// 将报表文档加载到 DocumentViewer 中
|
documentViewer1.DocumentSource = report;
|
}
|
}
|
}
|