FastReport绑定数据并进行打印 (1)

FastReport绑定数据并进行打印 (1)

ID:42614753

大小:151.00 KB

页数:6页

时间:2019-09-18

FastReport绑定数据并进行打印 (1)_第1页
FastReport绑定数据并进行打印 (1)_第2页
FastReport绑定数据并进行打印 (1)_第3页
FastReport绑定数据并进行打印 (1)_第4页
FastReport绑定数据并进行打印 (1)_第5页
资源描述:

《FastReport绑定数据并进行打印 (1)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、使用FastReport进行打印C#代码//准备工作:打开设计器创建一个空的报表LiShiChuFang.frxDataSetFDataSet=newDataSet();//fastreport中的数据源必须为DataSetif(mDtLishiChufang==null

2、

3、mDtLishiChufang.Rows.Count==0){MsgHelper.MessageBoxWarning("当前无需要打印的信息");return;}//为DataSet添加表并对表命名以方便区分在fastrep

4、ort中的数据源绑定DataTabletable=newDataTable();table.TableName="ChuFang";FDataSet.Tables.Add(table);//为table创建新列table.Columns.Add("Datetime",typeof(string));table.Columns.Add("YaoPinName",typeof(string));table.Columns.Add("ShuLiang",typeof(string));table.Co

5、lumns.Add("ZongDanwei",typeof(string));table.Columns.Add("YongLiang",typeof(string));table.Columns.Add("DanDanwei",typeof(string));table.Columns.Add("PinCi",typeof(string));table.Columns.Add("YongFa",typeof(string));table.Columns.Add("ChiXuTianShu",t

6、ypeof(string));table.Columns.Add("KaiDanRen",typeof(string));doubletotleMoney=0;//对table添加数据for(inti=0;i

7、hiChufang.Rows[i]["数量"].ToString(),mDtLishiChufang.Rows[i]["单位"].ToString(),mDtLishiChufang.Rows[i]["单量"].ToString(),mDtLishiChufang.Rows[i]["单量单位"].ToString(),mDtLishiChufang.Rows[i]["频次"].ToString(),mDtLishiChufang.Rows[i]["用法"].ToString(),mDtLishi

8、Chufang.Rows[i]["持续天数"].ToString(),mDtLishiChufang.Rows[i]["CaoZuoRenName"].ToString());if(mDtLishiChufang.Rows[i]["总价"]!=null&&mDtLishiChufang.Rows[i]["总价"].ToString().Length>0){totleMoney+=Convert.ToDouble(mDtLishiChufang.Rows[i]["总价"]);}else{conti

9、nue;}}//实例化FastReport并load需要的模板FastReport.Reportreport1=newFastReport.Report();report1.Load(Application.StartupPath+"\LiShiChuFang.frx");report1.RegisterData(FDataSet);//在fastreport中显示table的数据以便于进行数据绑定report1.GetDataSource("ChuFang").Enabled=true;Da

10、taTablereportdt=newDataTable();//对于fastreport中的参数进行数据绑定FastReport.Data.Parametert1=report1.GetParameter("JiuZhenBianHao");FastReport.Data.Parametert2=report1.GetParameter("KeHuName");FastReport.Data.Parametert3=report1.GetParameter("ChongWuName");Fas

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。