欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Grid++repor报表连接事件

程序员文章站 2022-04-24 13:12:52
//定义报表模板 private GridppReport Report = new GridppReport(); //载入报表模板数据 Report.LoadFromFile(GridppReportDemo.Utility.GetReportTemplatePath() + "program\ ......

//定义报表模板

private GridppReport Report = new GridppReport();

//载入报表模板数据

Report.LoadFromFile(GridppReportDemo.Utility.GetReportTemplatePath() + "program\\Sale detail of product.grf");

//设置与数据源的连接串,因为在设计时指定的数据库路径是绝对路径

Report.DetailGrid.Recordset.ConnectionString = GridppReportDemo.Utility.GetDatabaseConnectionString();

//连接报表取数事件

Report.Initialize += new _IGridppReportEvents_InitializeEventHandler(ReportInitialize);

Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecord);

//设定查询显示器关联的报表

axGRDisplayViewer1.Report = Report;