public void CrearFactura() { Reportes xReporte = new Reportes(); ReportDataSource rds = new ReportDataSource(); string Conexion = Properties.Settings.Default.Conexion; try { int Numero = 0; string Serie = ddSerie.SelectedValue.ToString(); Numero = int.Parse(txtNumero.Text); ReportViewer1.Reset(); ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/rpFacturaDetalle.rdlc"); rds.Name = "DataSetFacturaDetalle"; rds.Value = xReporte.Factura(Serie, Numero, Conexion); ReportViewer1.LocalReport.DataSources.Add(rds); ReportViewer1.ShowRefreshButton = true; Mensaje("Reporte generado correctamente", "success", ""); } catch (Exception ex) { Mensaje("Error: ", "danger", ex.Message); } }
public void CargarReporte() { Reportes xReporte = new Reportes(); ReportDataSource rds = new ReportDataSource(); string Conexion = Properties.Settings.Default.Conexion; int Numero = 0; try { ReportViewer1.Reset(); ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/rpEntradasYSalidasMercaderia.rdlc"); rds.Name = "DataSetEntradasYSalidasMercaderia"; if (chkOpcion.Checked) { rds.Value = xReporte.BoletasDetalle(Char.Parse(ddTipoBoleta.SelectedValue.ToString()), Conexion); } else { Numero = int.Parse(txtNumero.Text); rds.Value = xReporte.BoletasDetalle(Numero, Conexion); } ReportViewer1.LocalReport.DataSources.Add(rds); ReportViewer1.ShowRefreshButton = true; Mensaje("Reporte generado correctamente", "success", ""); } catch (Exception ex) { Mensaje("Error: ", "danger", ex.Message); } }
public void Reporte() { Reportes xReporte = new Reportes(); //Parametros indicados string Conexion = Properties.Settings.Default.Conexion; string FechaInicial, FechaFinal; int Sucursal; //Sucursal Seleccionada Sucursal = int.Parse(ddSucursales.SelectedValue); //Convertir las entradas a un formato de tiempo reconocible para SQL Sever FechaInicial = DateTime.Parse(txtFechaIni.Text).ToString("u"); FechaFinal = DateTime.Parse(txtFechaFin.Text).ToString("u"); //Creacion del reporte ReportViewer1.Reset(); ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/ReporteEntradas.rdlc"); ReportDataSource rds = new ReportDataSource(); rds.Name = "DataSetReporteEntradas"; rds.Value = xReporte.EntradaMercaderia(Sucursal, FechaInicial, FechaFinal, Conexion); ReportViewer1.LocalReport.DataSources.Add(rds); ReportViewer1.ShowRefreshButton = true; }