【问题标题】:crystal report to pdf without report viewer没有报表查看器的水晶报表到pdf
【发布时间】:2015-02-26 23:18:53
【问题描述】:

我想知道如何将水晶报表导出为pdf 格式文件,而无需在代码中指向水晶报表查看器。下面是我使用报告查看器的工作代码,但我希望没有它。

   private void getReportDocument()
    {
        using (connection = new MySqlConnection(strPigen_Deposit_Conn))
            if (this.OpenConnection() == true)
                try
                {
                    ReportDocument cryRpt = new ReportDocument();
                    cryRpt.Load("cryPaymentAdvise.rpt");
                    ParameterFields paramFields = new ParameterFields();
                    ParameterField paramField = new ParameterField();
                    ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
                    paramField.Name = "pDataID";
                    paramDiscreteValue.Value = strDataID;
                    paramField.CurrentValues.Add(paramDiscreteValue);
                    paramFields.Add(paramField);
                    crystalReportViewer1.ParameterFieldInfo = paramFields;
                    crystalReportViewer1.ReportSource = cryRpt;
                    cryRpt.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, "PaymentAdvise.pdf");


                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    return;
                }

    }

【问题讨论】:

    标签: c# pdf crystal-reports


    【解决方案1】:

    没办法
    你不能。

    如果你想管理 Crystaleport,你需要 CrystalReportViewer。

    如果您想在不安装 CrystalReports 运行时创建 PDF,有很多解决方案,但这不是您的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-12-30
      • 2017-08-21
      • 1970-01-01
      • 2023-03-13
      • 1970-01-01
      • 2012-08-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多