예제 #1
0
        public void FacturaCliente()
        {
            ReportParameter[] parametros = new ReportParameter[1];
            reportViewer1.ProcessingMode = ProcessingMode.Local;
            lc = reportViewer1.LocalReport;
            //lc.ReportPath = "Reportes\\FacturaCliente.rdlc";
            lc.ReportPath = "Reportes\\FacturaCliente.rdlc";
            facturacionDataSet ds = new facturacionDataSet();

            facturacionDataSetTableAdapters.facturaClienteTableAdapter rds  = new facturacionDataSetTableAdapters.facturaClienteTableAdapter();
            facturacionDataSetTableAdapters.obtenerFacturaTableAdapter rds1 = new facturacionDataSetTableAdapters.obtenerFacturaTableAdapter();
            rds.Fill(ds.facturaCliente, Program.GfacturaId);  //llenar reporte
            rds1.Fill(ds.obtenerFactura, Program.GfacturaId);
            ReportDataSource rd = new ReportDataSource();

            rd.Name       = "DataSet1";
            rd.Value      = ds.Tables["facturaCliente"];
            parametros[0] = new ReportParameter("RptCajero", Program.GnombreUsuario);
            ReportDataSource rd1 = new ReportDataSource();

            rd1.Name  = "DataSet2";
            rd1.Value = ds.Tables["obtenerFactura"];

            reportViewer1.LocalReport.DataSources.Clear();
            reportViewer1.LocalReport.SetParameters(parametros);
            lc.DataSources.Add(rd);
            lc.DataSources.Add(rd1);

            AutoPrintCls atp = new AutoPrintCls(lc);

            atp.Print();
            //this.reportViewer1.RefreshReport();
            //lc.PrintToPrinter();
            this.Close();
        }
예제 #2
0
        //AutoPrint - Ennvía a la impresora directamente el reporte de factura.
        private void AutoPrint()
        {
            AutoPrintCls autoprintme = new AutoPrintCls(RvFactura.LocalReport);

            autoprintme.PrinterSettings.PrinterName = "EPSON LX-300+ /II";
            autoprintme.Print();
        }