C# winfrom FastReport 变量设计加载

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[0], "tbEmpRecord");
                FsReport.RegisterData(dst.Tables[1], "tbEmpEduca");
                FsReport.RegisterData(dst.Tables[2], "tbEmpSociety");
                FsReport.RegisterData(dst.Tables[3], "tbEmpTech");
                FsReport.RegisterData(dst.Tables[4], "tbEmpCont");

                textBarcode = dt.Rows[0]["IDCard"].ToString() + "  " + dt.Rows[0]["Name"].ToString();
                TextObject pTextPrint = FsReport.FindObject("TextPrintTime") as TextObject;
                (FsReport.FindObject("Barcode1") as BarcodeObject).Text = textBarcode;
                pTextPrint.Text = SystemTime;
                FsReport.Show();
                FsReport.Dispose();

2、报表设计

 

注:报表树名字要有。

 

posted @ 2016-09-03 10:13  一枚水  阅读(2709)  评论(0编辑  收藏  举报