Exemplo n.º 1
0
 private void btnExportar_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.dgvDetalle.DataSource != null)
         {
             var path = string.Format("{0}{1}{2}{3}", GlobalClass.ConfiguracionGlobal.pathReportes, "Kardex_", DateTime.Now.ToString("s").Replace(":", "-"), ".csv");
             UtilLocal.OnExportGridToCSV(this.dgvDetalle, path);
             var fileInfo = new FileInfo(path);
             if (fileInfo.Exists)
             {
                 System.Diagnostics.Process.Start(path);
             }
         }
     }
     catch (Exception ex)
     {
         Util.MensajeError(ex.Message, GlobalClass.NombreApp);
     }
 }