Beispiel #1
0
 public static void LoadReporte()
 {
     Frm_Sis_ReportesView forma = new Frm_Sis_ReportesView();
     ReportDocument rpt = new ReportDocument();
     try
     {
         string rutaRpt = Helper.fRutaReporte();
         rpt.Load(rutaRpt + "usuarios.rpt", OpenReportMethod.OpenReportByDefault);
         forma.Report.ReportSource = rpt;
         forma.Dispose();
         rpt.Dispose();
     }
     catch (Exception ex) { throw ex; }
     finally { forma = null; rpt = null; }
 }
Beispiel #2
0
 public static void MostrarReporte(string sTitulo, string nombrereporte, DataTable Dt, params string[] matriz)
 {
     Frm_Sis_ReportesView forma = new Frm_Sis_ReportesView();
     ReportDocument rpt = new ReportDocument();
     try
     {
         string rutaRpt = Helper.fRutaReporte();
         rpt.Load(rutaRpt + nombrereporte + ".rpt", OpenReportMethod.OpenReportByDefault);
         rpt.SetDataSource(Dt);
         for (int c = 0; c < matriz.Length; c++)
         {
             rpt.DataDefinition.FormulaFields[c].Text = "'" + matriz[c].ToString() + "'";
         }
         forma.Report.ReportSource = rpt;
         forma.Text = sTitulo;
         forma.ShowDialog();
         forma.Dispose();
         rpt.Dispose();
     }
     catch (Exception ex) { throw ex; }
     finally { forma = null; rpt = null; }
 }