【问题标题】:How to set number of copies in crystal reports?水晶报表如何设置份数?
【发布时间】:2016-06-10 19:34:00
【问题描述】:

我正在使用 Visual Studio 2010 创建一个水晶报表,并将 ADO 数据集用于报表上的数据库字段。现在我想在水晶报表查看器的打印按钮上设置默认的 2 份账单副本。我在水晶报表查看器负载上编写的代码是

Report.Bill objRpt = new Report.Bill();
objRpt.SetDataSource(DT1);
objRpt.PrintToPrinter(2, true, 0, 0);
crystalReportViewer1.ReportSource = objRpt;
crystalReportViewer1.Refresh(); 

但它只打印单份账单。谁能告诉我该如何解决?我是水晶报表的新手。

【问题讨论】:

标签: c# c#-4.0 crystal-reports crystal-reports-2010


【解决方案1】:
private void button1_Click(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand("//Your Query//");
        //SqlCommand cmd = new SqlCommand();
        //cmd.CommandText = "GetSalesCrystalReport";
        //cmd.CommandType = CommandType.StoredProcedure;
        //cmd.Parameters.AddWithValue("@ReferenceNo", txtReferenceNo.Text);
        DataTable dt1 = DataManager.GetDataTable(cmd);
        Sales objRpt3 = new Sales();
        objRpt3.SetDataSource(dt1);
        objRpt3.PrintToPrinter(1, false, 0, 0);

    }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-03
    • 2022-12-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多