.net FastReportd的说明

来源:互联网 发布:赛尔网络 招聘 编辑:程序博客网 时间:2024/06/09 15:55

这个东东是用做报表的

然后是,可以快速方便的设计自己报表的格式

支持任意水印和背景图片

三个dll,去网上找,FastReport.Bars.dll,FastReport.dll,FastReport.Editor.dll或者去所谓官网下

分两部:

  1部.对报表的设计           

 2.部,在工程项目里面引用报表,为报表添加数据,然后打印报表。

 FastReport.Report report = new FastReport.Report(); 

 report.Load(path);

  report.RegisterData(dataTb, this.Name);//
            report.PrintSettings.Printer =  prName;

          report.PrintPrepared();//准备打印

           report.PrintSettings.ShowDialog = false;//=不显示打印设置框,直接选择默认打印机 打印
            report.PrintSettings.Copies = 1;//打印份数设置
            EnvironmentSettings a = new EnvironmentSettings();
            a.ReportSettings.ShowProgress = false;
            report.Print();//打印  

3.背景水印可以直接在打印的时候写上去

           ReportPage page = report.Pages[0] as ReportPage;
                Watermark watermark = new Watermark();
                watermark.Enabled = true;
                watermark.Font = new Font(watermark.Font.FontFamily, (float)40, FontStyle.Bold);
                watermark.Text = yymc;
                watermark.Font = new Font(watermark.Font.FontFamily, (float)40, FontStyle.Bold);
                page.Watermark = watermark;

4.在填充数据的时候,注意名称要对应,不然会报错找不到字段数据

   xxx.frx文件的ReferenceName="prName"

大概就是这样,具体设计报表样式可以参考.netFastReport里面的Demo.exe,基本上需要的格式都有


0 0
原创粉丝点击