private void button1_Click(object sender, EventArgs e)
{
GrapeCity.ActiveReports.PageReport rpt = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(@"PageReport1.rdlx"));
rpt.Document.LocateDataSource += new GrapeCity.ActiveReports.LocateDataSourceEventHandler(locatedata1);
GrapeCity.ActiveReports.Document.PageDocument rpdt = new GrapeCity.ActiveReports.Document.PageDocument(rpt);
this.viewer1.LoadDocument(rpdt);
}
private void locatedata1(object cender, GrapeCity.ActiveReports.LocateDataSourceEventArgs args)
{
if (args.DataSourceName == "DataSource1" && args.DataSetName == "DataSet1")
{
DataSet ds =DBHelperSQL.Query("select * from Hj_basicinfo");
args.Data = ds.Tables[0];
}
}
|