title: crystal report to pdf without report viewer
body: <p>I would like to know how to export crystal report to <code>pdf</code> format file without pointing to crystal report viewer in code. Below is my working code with report viewer but I would want to do so without it.</p>
  
  <pre><code>   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;
                  }
  
      }
  </code></pre>