private void reporteHallazgoDataBind() { HallazgoWS.HallazgoClient client = null; try { client = new HallazgoWS.HallazgoClient(); listaHallazgos = client.WSListarHallazgoReporte(Convert.ToInt32(combo_HallazgoCurso.SelectedItem.Value), Convert.ToInt32(combo_HallazgoCiclo.SelectedItem.Value)); grdHallazgos.DataSource = listaHallazgos.LstHallazgoReporte; grdHallazgos.DataBind(); } catch (Exception ex) { MostrarAlert("DATA BIND, REPORTE HALLAZGOS: " + ex.Message); } finally { client = null; } /* InformeFinCicloBE informe = new InformeFinCicloBE(); informe.CursoId = Convert.ToInt32(combo_HallazgoCurso.SelectedItem.Value); informe.PeriodoId = Convert.ToInt32(combo_HallazgoCiclo.SelectedItem.Value); HallazgoBC objHallazgoBC = new HallazgoBC(); reporteHallazgosBE = objHallazgoBC.listarReporteHallazgo(informe); grdHallazgos.DataSource = reporteHallazgosBE.LstHallazgoReporte; grdHallazgos.DataBind(); */ }
protected void btnExportaHallazgo_Click(object sender, EventArgs e) { if (listaHallazgos.LstHallazgoReporte.Count() <= 0) { MostrarAlert("No existen hallazgos en la bandeja."); } else { PDFGenerator pdf = new PDFGenerator(); HallazgoWS.HallazgoClient client = null; HallazgoWS.HallazgoReporteCollectionDC hallazgos = null; try { client = new HallazgoWS.HallazgoClient(); hallazgos = client.WSListarHallazgoReporte( Convert.ToInt32(combo_HallazgoCurso.SelectedItem.Value), Convert.ToInt32(combo_HallazgoCiclo.SelectedItem.Value)); //HALLAZGOS DataTable tableHallazgos = new DataTable(); tableHallazgos.Columns.Add("Codigo"); tableHallazgos.Columns.Add("Descripcion"); tableHallazgos.Columns.Add("Curso"); for (int i = 0; i < hallazgos.LstHallazgoReporte.Count(); i++) { DataRow row = tableHallazgos.NewRow(); row[0] = hallazgos.LstHallazgoReporte[i].CodigoHallazgo; row[1] = hallazgos.LstHallazgoReporte[i].Descripcion; row[2] = hallazgos.LstHallazgoReporte[i].NombreCurso; tableHallazgos.Rows.Add(row); } String ruta = Server.MapPath("~/Reportes/Hallazgos.pdf"); pdf.generearReporteHallazgos(combo_HallazgoCurso.SelectedItem.Text, combo_HallazgoCiclo.SelectedItem.Text, tableHallazgos, ruta); } catch (Exception ex) { MostrarAlert("EXPORTAR HALLAZGOS: " + ex.Message); } finally { client = null; } } }