zoukankan      html  css  js  c++  java
  • RDLC报表多页打印时的一些问题

    有多页数据需要打印时,RDCL报表有时会发生只能打印第一页的情况,而点击了打印布局按钮后,有时能正常的打印后续页。

    鉴于这种情况,我们可以控制打印界面的呈现模式,避开这个小Bug,代码如下:

    public frmFirstCases_Print(DataSet ds)
    {
        InitializeComponent();
        this.DsSource = ds;
    }
     
    private void frmFirstCases_Print_Load(object sender, EventArgs e)
    {
        // 设置本地报表的路径(App.SysPath通常指向程序启动的框架)
        this.reportViewer1.LocalReport.ReportPath = App.SysPath + "\\First_Cases.rdlc";
     
        // 清空并添加报表数据源
        reportViewer1.LocalReport.DataSources.Clear();
        this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DsReportSource_Cover_Info",
            DsSource.Tables[0]));
        this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DsReportSource_Cover_Diagnose",
            DsSource.Tables[1]));
        this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DsReportSource_Cover_Operation",
            DsSource.Tables[2]));
        this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DsReportSource_Cover_Quality",
            DsSource.Tables[3]));
        this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DsReportSource_Cover_Temp",
            DsSource.Tables[4]));
     
        // 呈现报表
        this.reportViewer1.RefreshReport();
     
        // 将显示模式切换到打印布局模式
        this.reportViewer1.SetDisplayMode(DisplayMode.PrintLayout);
     
        // 将缩放模式设置为百分比
        this.reportViewer1.ZoomMode = ZoomMode.Percent;
     
        // 设为 100% 
        this.reportViewer1.ZoomPercent = 100;
    }
  • 相关阅读:
    发送短信/邮件/打电话 code(转)
    如何学习算法
    堆和栈的区别
    2010 baidu笔试
    关于TableView中图片的延时加载(转)
    sqlite + UITableView 实现iPhone大数据浏览
    2010 Google中国笔试试题
    海量数据处理方法总结(转)
    IPhone WebApp 设计开发工具与资源(转)
    DynamicDataSet
  • 原文地址:https://www.cnblogs.com/SkySoot/p/2323900.html
Copyright © 2011-2022 走看看