private void btnguardar_Click(object sender, EventArgs e)
        {
            carnets objcarts = new carnets();

            objcarts.SetParameterValue("@numer", idcarnet);
            string user = Environment.UserName.ToString();
            string dir  = @"C:\Users\" + user + @"\Documents\Parking_Storage\Carnets\";

            objcarts.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, dir + codpark + ".pdf");
            this.DialogResult = DialogResult.OK;
            this.Hide();
        }
 private void repoCarnet_Load(object sender, EventArgs e)
 {
     try
     {
         carnets objcarts = new carnets();
         objcarts.SetParameterValue("@numer", idcarnet);
         crystalReportViewer1.ReportSource = objcarts;
     }
     catch (Exception)
     {
         error.label2.Text = "Ocurrió un error en la ejecución,\nvuelva a inténtarlo más tarde";
         result            = error.ShowDialog();
         if (result == DialogResult.OK)
         {
         }
     }
 }
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
     carnets rpt = new carnets();
     rpt.Site = this.Site;
     return rpt;
 }