1、源码

 DataTable dt5 = new DataTable();
dt5 = SqlHelper.SqlGetDataTable(StrSql, "tbEmpCont");
dst.Tables.Add(dt5.Copy());
//string reportpath = AppDomain.CurrentDomain.BaseDirectory+"\OtDevPgCard.frx";
//FsReport.Load(@"..\OtDevPgCard.frx");
FsReport.Load(@"FastReport\OtEmpRecord.frx");
FsReport.RegisterData(dst.Tables[], "tbEmpRecord");
FsReport.RegisterData(dst.Tables[], "tbEmpEduca");
FsReport.RegisterData(dst.Tables[], "tbEmpSociety");
FsReport.RegisterData(dst.Tables[], "tbEmpTech");
FsReport.RegisterData(dst.Tables[], "tbEmpCont"); textBarcode = dt.Rows[]["IDCard"].ToString() + " " + dt.Rows[]["Name"].ToString();
TextObject pTextPrint = FsReport.FindObject("TextPrintTime") as TextObject;
(FsReport.FindObject("Barcode1") as BarcodeObject).Text = textBarcode;
pTextPrint.Text = SystemTime;
FsReport.Show();
FsReport.Dispose();

2、报表设计
C# winfrom FastReport 变量设计加载-LMLPHP

注:报表树名字要有。

05-29 00:03