zoukankan      html  css  js  c++  java
  • 水晶报表打印

    水晶报表打印问题:

    ReportDocument aReportDocument = new ReportDocument();

    //加载报表

     aReportDocument.Load(@Application.StartupPath + Properties.Settings.Default.MainReportPath);

    //子报表数据源

    aReportDocument.Subreports["SonRpt.rpt"].SetDataSource(sonDs);

    //传递参数

     aReportDocument.SetParameterValue("Name", Class.Name);

    //登录

    foreach (Table aTable in aReportDocument.Database.Tables)
    {
     aTable.LogOnInfo.ConnectionInfo.ServerName = Properties.Settings.Default.ServerName;
     aTable.LogOnInfo.ConnectionInfo.UserID = Properties.Settings.Default.UserID;
     aTable.LogOnInfo.ConnectionInfo.Password = Properties.Settings.Default.Password

     aTable.ApplyLogOnInfo(aTable.LogOnInfo);

    }

    //指定系统默认打印机位报表打印机

     PrintDocument printDc = new PrintDocument();
     aReportDocument.PrintOptions.PrinterName = printDc.PrinterSettings.PrinterName;

    //如果没有上面两句,默认打印机是在水晶报表中指定的
     aReportDocument.PrintToPrinter(1, true, 0, 0);
     aReportDocument.Dispose();

  • 相关阅读:
    RHEL安装oracle客户端(版本为11.2)
    为服务器设置固定IP地址
    RHEL配置本地yum
    网线水晶头内线排序
    《汇编语言(第三版)》王爽著----读书笔记01
    kali系统越来越大解决
    Markdown入门简介
    Linux之tail命令
    Linux之df命令
    Linux命令
  • 原文地址:https://www.cnblogs.com/stoneFang/p/6715315.html
Copyright © 2011-2022 走看看