private void PrintForm_Load(object sender, EventArgs e)
 {
     try
     {
         reportViewer1.LocalReport.ReportPath = "C:\\Users\\Udara Ranatunga\\Documents\\Visual Studio 2015\\Projects\\Inventory Control System\\Inventory Control System\\PrintPurchaseReceipt.rdlc";
         _orderdetail = OrdersDetailBindingSource.Current as OrdersDetail;
         reportViewer1.ProcessingMode         = Microsoft.Reporting.WinForms.ProcessingMode.Local;
         OrdersDetailBindingSource.DataSource = _list;
         Microsoft.Reporting.WinForms.ReportParameter[] rparams = new Microsoft.Reporting.WinForms.ReportParameter[]
         {
             new Microsoft.Reporting.WinForms.ReportParameter("Purchase_OrderNo", _orders.Purchase_OrderNo.ToString()),
             new Microsoft.Reporting.WinForms.ReportParameter("Purchase_OrderDate", _orders.Purchase_OrderDate.ToString()),
             new Microsoft.Reporting.WinForms.ReportParameter("Item_Name", _orders.Item_Name.ToString()),
             new Microsoft.Reporting.WinForms.ReportParameter("Item_Qty", _orders.Item_Qty.ToString()),
             new Microsoft.Reporting.WinForms.ReportParameter("Sub_Total", _orders.Sub_Total.ToString()),
             new Microsoft.Reporting.WinForms.ReportParameter("Supplier_Name", _orders.Supplier_Name.ToString()),
             new Microsoft.Reporting.WinForms.ReportParameter("Users_ID", _orders.Users_ID.ToString())
         };
         reportViewer1.LocalReport.SetParameters(rparams);
         reportViewer1.RefreshReport();
     }
     catch (Exception er)
     {
         MessageBox.Show(er.ToString());
     }
 }
Exemplo n.º 2
0
        private void frmRptListaDePagos_Load(object sender, EventArgs e)
        {
            //DataTable xd = new DataTable();
            //xd.Columns.Add("Wan");
            //xd.Columns.Add("MontoTotal");
            //DataRow r = xd.NewRow();
            //r[0] = "Matri";
            //r[1] = "120";
            //xd.Rows.Add(r);
            ReportDataSource rds  = new ReportDataSource("dsListado", tabledata);
            ReportDataSource rds1 = new ReportDataSource("dsAlumno", alumno);
            ReportDataSource rds2 = new ReportDataSource("dsLeyenda", dtLeyenda);
            ReportDataSource rds3 = new ReportDataSource("dsSaldo", dtsaldo);

            Microsoft.Reporting.WinForms.ReportParameter[] para = new Microsoft.Reporting.WinForms.ReportParameter[]
            {
                new Microsoft.Reporting.WinForms.ReportParameter("pUsuario", usuario)
            };
            this.reportViewer1.LocalReport.SetParameters(para);
            this.reportViewer1.LocalReport.DataSources.Add(rds);
            this.reportViewer1.LocalReport.DataSources.Add(rds1);
            this.reportViewer1.LocalReport.DataSources.Add(rds2);
            this.reportViewer1.LocalReport.DataSources.Add(rds3);
            this.reportViewer1.RefreshReport();
        }
        private void estimaciondeInteresesdeAhorroNavideno()
        {
            List <SqlParameter> lstParameters = new List <SqlParameter>();
            SqlParameter        parametro     = new SqlParameter("@dtmFechaCuo", SqlDbType.DateTime);

            parametro.Value = this.dtpFecha.Value;
            lstParameters.Add(parametro);
            parametro       = new SqlParameter("@strUsuario", "aftabares");
            parametro.Value = "aftabares";
            lstParameters.Add(parametro);
            DataSet ds = new DataSet();

            ds         = propiedades.ejecutarSp(lstParameters, "spAhorrosNatilleraEscolarCalcularIntereses");
            datasource = new ReportDataSource("calcularInteresesAhorrosNavidenos_spAhorrosNavidenoCalcularIntereses", ds.Tables[0]);
            this.contruirGuardar(ds.Tables[0]);

            List <Microsoft.Reporting.WinForms.ReportParameter> lstParametros = new List <Microsoft.Reporting.WinForms.ReportParameter>();

            Microsoft.Reporting.WinForms.ReportParameter parametroReporte = new Microsoft.Reporting.WinForms.ReportParameter("dtmFechaCuota", DateTime.Now.ToString());
            lstParametros.Add(parametroReporte);
            parametroReporte = new Microsoft.Reporting.WinForms.ReportParameter("strUsuario", "qqq");
            lstParametros.Add(parametroReporte);

            rptAhorrosInteresesaFuturo.Reset();
            rptAhorrosInteresesaFuturo.ProcessingMode = ProcessingMode.Local;
            rptAhorrosInteresesaFuturo.LocalReport.DataSources.Clear();
            rptAhorrosInteresesaFuturo.LocalReport.DataSources.Add(datasource);
            rptAhorrosInteresesaFuturo.LocalReport.ReportEmbeddedResource = "Mutuales2020.Ahorros.Reportes.rptAhorrosNavidenoIntereses.rdlc";
            //rptAhorrosInteresesaFuturo.LocalReport.SetParameters(lstParametros);
            rptAhorrosInteresesaFuturo.LocalReport.Refresh();
        }
Exemplo n.º 4
0
        private void ReportViewer_Load(object sender, EventArgs e)
        {
            SqlServerTypes.Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory);


            AddReportDataSouce();


            Microsoft.Reporting.WinForms.ReportParameter[] rParams = new Microsoft.Reporting.WinForms.ReportParameter[]
            {
                new Microsoft.Reporting.WinForms.ReportParameter("CompanyName", Settings.Default["BusinessName"].ToString()),
                new Microsoft.Reporting.WinForms.ReportParameter("CompanyOwner", Settings.Default["CompanyTitle"].ToString() +
                                                                 " " + Settings.Default["CompanyOwner"].ToString()),
                new Microsoft.Reporting.WinForms.ReportParameter("CompanyAddress", Settings.Default["CompanyPostcode"].ToString() +
                                                                 " " + Settings.Default["CompanyCity"].ToString() +
                                                                 "\n" + Settings.Default["CompanyCountry"].ToString()),
                new Microsoft.Reporting.WinForms.ReportParameter("CompanyPhone", Settings.Default["CompanyPhone"].ToString()),
                new Microsoft.Reporting.WinForms.ReportParameter("CompanyEMail", Settings.Default["CompanyEMail"].ToString()),
            };

            reportViewer1.LocalReport.SetParameters(rParams);
            this.reportViewer1.RefreshReport();

            this.reportViewer1.RefreshReport();
        }
        private void btnEjecutar_Click(object sender, EventArgs e)
        {
            List <SqlParameter> lstParameters = new List <SqlParameter>();
            SqlParameter        parametro     = new SqlParameter("@intCodigo", SqlDbType.Int);

            parametro.Value = this.txtCodigo.Text;
            lstParameters.Add(parametro);
            DataSet ds = new DataSet();

            ds = propiedades.ejecutarSp(lstParameters, "spSocioBeneficiario");
            ReportDataSource datasource;

            datasource = new ReportDataSource("spSocioBeneficiario_spSocioBeneficiario", ds.Tables[0]);

            List <Microsoft.Reporting.WinForms.ReportParameter> lstParametros = new List <Microsoft.Reporting.WinForms.ReportParameter>();

            Microsoft.Reporting.WinForms.ReportParameter parametroReporte = new Microsoft.Reporting.WinForms.ReportParameter("Mutual", propiedades.strNombreMutual);
            lstParametros.Add(parametroReporte);

            rptSocioyAgraciados.Reset();
            rptSocioyAgraciados.ProcessingMode = ProcessingMode.Local;
            rptSocioyAgraciados.LocalReport.DataSources.Clear();
            rptSocioyAgraciados.LocalReport.DataSources.Add(datasource);
            rptSocioyAgraciados.LocalReport.ReportEmbeddedResource = "Mutuales2020.Utilidades.Reportes.rptSociosyBeneficiarios.rdlc";
            rptSocioyAgraciados.LocalReport.SetParameters(lstParametros);
            rptSocioyAgraciados.LocalReport.Refresh();

            this.rptSocioyAgraciados.RefreshReport();
        }
Exemplo n.º 6
0
        private void PrntRpt(string printer, bool landscape, string rpt, int copies, IList <string> Params)
        {
            _landscape = landscape;
            var parameters = new List <ReportParameter>();

            for (var i = 0; i < Params.Count - 1; i += 2)
            {
                var pName  = Params[i];
                var pValue = Params[i + 1];
                var param  = new ReportParameter(pName, pValue);
                parameters.Add(param);
            }

            var server = Data.SystemVariables.SsrsServerUri;

            var path = Data.SystemVariables.SsrsReportPath;

            var report = ConfigureReport(rpt, path, server, parameters);

            var baReport = GetReportByteArray(report);

            for (var i = 0; i < copies; i++)
            {
                PrintReport(printer, _landscape, baReport);
            }
        }
Exemplo n.º 7
0
        private void fromPrint_Load(object sender, EventArgs e)
        {
            DateTime fromDate = Convert.ToDateTime(fromToDate[0]);
            DateTime toDate   = Convert.ToDateTime(fromToDate[1]);
            string   DrName   = "Dr. Hazrat Ali Khan. Technician, Pishawer. (RCCD) & MBBS Canada";

            OrderDetailBindingSource.DataSource = _list;
            Microsoft.Reporting.WinForms.ReportParameter[] p = new Microsoft.Reporting.WinForms.ReportParameter[]
            {
                new Microsoft.Reporting.WinForms.ReportParameter("paraFromDate", fromDate.ToString("MM/dd/yyyy")),
                new Microsoft.Reporting.WinForms.ReportParameter("paraToDate", toDate.ToString("MM/dd/yyyy")),
                new Microsoft.Reporting.WinForms.ReportParameter("paraDrName", DrName),
                new Microsoft.Reporting.WinForms.ReportParameter("paraSyrupCount", _list.Where(m => m.MedType == 1).Count().ToString()),
                new Microsoft.Reporting.WinForms.ReportParameter("paraTabletCount", _list.Where(m => m.MedType == 3).Count().ToString()),
                new Microsoft.Reporting.WinForms.ReportParameter("paraInjCount", _list.Where(m => m.MedType == 2).Count().ToString()),
                new Microsoft.Reporting.WinForms.ReportParameter("paraOthersCount", _list.Where(m => m.MedType == 4).Count().ToString()),
                new Microsoft.Reporting.WinForms.ReportParameter("paraPatientsCount", _list.Select(m => m.PID).Count().ToString())
            };
            this.reportViewer.LocalReport.SetParameters(p);
            reportViewer.LocalReport.DataSources.Clear();
            ReportDataSource datasource = new ReportDataSource("MedicineDs", _list);

            reportViewer.LocalReport.DataSources.Add(datasource);
            reportViewer.LocalReport.Refresh();

            this.reportViewer.RefreshReport();
        }
Exemplo n.º 8
0
        private void btn_TaoBaoCao_Click(object sender, EventArgs e)
        {
            NgayLapBC = dateTimePicker1.Value;
            List <BCSachTraTreDtos> BC = new List <BCSachTraTreDtos>();
            BCSachTraTreService     SV = new BCSachTraTreService();

            BC = SV.loadBaoCaoToDate(NgayLapBC);
            string   NguoiLap = GetDataDAO.Instance.getNguoiLapBaoCao();
            string   SoNgay   = GetDataDAO.Instance.TongSoLuotMuon(NgayLapBC);
            DateTime ngayLap  = DateTime.Now;
            string   NgayLap  = ngayLap.ToString();

            //Khai báo chế độ xử lý báo cáo, trong trường hợp này lấy báo cáo ở local
            RpvBaoCao.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local;
            ReportDataSource rds = new ReportDataSource();

            rds.Name  = "rpBaoCaoTra";
            rds.Value = BC;
            Microsoft.Reporting.WinForms.ReportParameter[] para = new Microsoft.Reporting.WinForms.ReportParameter[]
            {
                new Microsoft.Reporting.WinForms.ReportParameter("rpNguoiLap1", NguoiLap),
                new Microsoft.Reporting.WinForms.ReportParameter("rpTongS", SoNgay),
                new Microsoft.Reporting.WinForms.ReportParameter("rpNgayLap", NgayLap),
            };
            this.RpvBaoCao.LocalReport.SetParameters(para);
            RpvBaoCao.LocalReport.DataSources.Clear();
            RpvBaoCao.LocalReport.DataSources.Add(rds);
            //Refresh lại báo cáo
            RpvBaoCao.RefreshReport();
        }
 public void LoadReport()
 {
     try
     {
         this.reportViewer1.LocalReport.EnableExternalImages = true;
         var list  = (new Taxi_Model.TaxiDataContext().stp_PaymentCollection()).ToList();
         var list2 = (list.AsEnumerable().OrderBy(item => item.DriverNo, new NaturalSortComparer <string>())).ToList();
         this.stp_PaymentCollectionResultBindingSource.DataSource = list2;
         DateTime?dtCurrent = list.Max(c => c.FromDate).ToDateorNull();
         DateTime?dtEnd     = list.Max(c => c.ToDate).ToDateorNull();
         Microsoft.Reporting.WinForms.ReportParameter[] param = new Microsoft.Reporting.WinForms.ReportParameter[1];
         string heading = string.Empty;
         heading = "from " + string.Format("{0:dd/MM/yyyy}", dtCurrent) + " to " + string.Format("{0:dd/MM/yyyy}", dtEnd);
         //heading = "From: "+string.Format("{0:dd/MM/yyyy}", dtFrom) + " To: " + string.Format("{0:dd/MM/yyyy}", dtTill);
         // string EndDate = string.Format("{0:dd/MM/yyyy}", DateTime.Now);
         //string To = string.Format("{0:dd/MM/yyyy}", dtTill);
         param[0] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_EndDate", heading);
         //List<ClsLogo> objLogo = new List<ClsLogo>();
         //objLogo.Add(new ClsLogo { ImageInBytes = AppVars.objSubCompany.CompanyLogo != null ? AppVars.objSubCompany.CompanyLogo.ToArray() : null });
         //ReportDataSource imageDataSource = new ReportDataSource("Taxi_AppMain_Classes_ClsLogo", objLogo);
         //this.reportViewer1.LocalReport.DataSources.Add(imageDataSource);
         reportViewer1.LocalReport.SetParameters(param);
         this.reportViewer1.ZoomPercent = 100;
         this.reportViewer1.ZoomMode    = Microsoft.Reporting.WinForms.ZoomMode.Percent;
         this.reportViewer1.RefreshReport();
     }
     catch (Exception ex)
     {
         ENUtils.ShowMessage(ex.Message);
     }
 }
Exemplo n.º 10
0
        public ReciboPerso(string nomeCliente, string codCliente, string cepCliente, string ufcliente, string cidadeCliente, string enderecoCliente, string numeroCliente,
                           string bairroCliente, string servicoCliente, string valorCliente, string valorExtCliente, string mes_referencia, string data_pgto)
        {
            InitializeComponent();
            reportViewer1.LocalReport.ReportEmbeddedResource = "Gerador_de_Recibos.Reports.ReciboPersonalizado.rdlc";

            Microsoft.Reporting.WinForms.ReportParameter[] p = new Microsoft.Reporting.WinForms.ReportParameter[13];

            p[0]  = new Microsoft.Reporting.WinForms.ReportParameter("cliente", nomeCliente);
            p[1]  = new Microsoft.Reporting.WinForms.ReportParameter("codigo", codCliente);
            p[2]  = new Microsoft.Reporting.WinForms.ReportParameter("cep", cepCliente);
            p[3]  = new Microsoft.Reporting.WinForms.ReportParameter("uf", ufcliente);
            p[4]  = new Microsoft.Reporting.WinForms.ReportParameter("cidade", cidadeCliente);
            p[5]  = new Microsoft.Reporting.WinForms.ReportParameter("numero", numeroCliente);
            p[6]  = new Microsoft.Reporting.WinForms.ReportParameter("endereco", enderecoCliente);
            p[7]  = new Microsoft.Reporting.WinForms.ReportParameter("bairro", bairroCliente);
            p[8]  = new Microsoft.Reporting.WinForms.ReportParameter("servico", servicoCliente);
            p[9]  = new Microsoft.Reporting.WinForms.ReportParameter("valor", valorCliente);
            p[10] = new Microsoft.Reporting.WinForms.ReportParameter("valor_extenso", valorExtCliente);
            p[11] = new Microsoft.Reporting.WinForms.ReportParameter("mes_referencia", mes_referencia);
            p[12] = new Microsoft.Reporting.WinForms.ReportParameter("data_pgto", data_pgto);

            reportViewer1.LocalReport.SetParameters(p);

            this.reportViewer1.LocalReport.Refresh();
            this.reportViewer1.SetDisplayMode(DisplayMode.PrintLayout);
            var setup = reportViewer1.GetPageSettings();

            setup.Margins = new System.Drawing.Printing.Margins(2, 2, 2, 2);
            reportViewer1.SetPageSettings(setup);
        }
        private void estimaciondeInteresesdeAhorroaFuturo()
        {
            List <SqlParameter> lstParameters = new List <SqlParameter>();
            SqlParameter        parametro     = new SqlParameter("@dtmFechaCuo", SqlDbType.DateTime);

            parametro.Value = DateTime.Now;
            lstParameters.Add(parametro);
            parametro       = new SqlParameter("@strUsuario", "aftabares");
            parametro.Value = "aftabares";
            lstParameters.Add(parametro);
            DataSet ds = new DataSet();

            ds         = propiedades.ejecutarSp(lstParameters, "spAhorrosaFuturoCalcularIntereses");
            datasource = new ReportDataSource("dbExequial2010DataSet_spAhorrosaFuturoCalcularIntereses", ds.Tables[0]);
            this.contruirGuardar(ds.Tables[0]);

            List <Microsoft.Reporting.WinForms.ReportParameter> lstParametros = new List <Microsoft.Reporting.WinForms.ReportParameter>();

            Microsoft.Reporting.WinForms.ReportParameter parametroReporte = new Microsoft.Reporting.WinForms.ReportParameter("dtmFechaCuota", DateTime.Now.ToString());
            lstParametros.Add(parametroReporte);
            parametroReporte = new Microsoft.Reporting.WinForms.ReportParameter("strUsuario", "qqq");
            lstParametros.Add(parametroReporte);

            rptAhorrosInteresesaFuturo.Reset();
            rptAhorrosInteresesaFuturo.ProcessingMode = ProcessingMode.Local;
            rptAhorrosInteresesaFuturo.LocalReport.DataSources.Clear();
            rptAhorrosInteresesaFuturo.LocalReport.DataSources.Add(datasource);
            rptAhorrosInteresesaFuturo.LocalReport.ReportEmbeddedResource = "Mutuales2020.Ahorros.Reportes.rptAhorrosaFuturoIntereses.rdlc";
//            rptAhorrosInteresesaFuturo.LocalReport.ReportPath = ConfigurationManager.AppSettings["rutaReportes"].ToString() + "rptAhorrosaFuturoIntereses.rdlc";
            rptAhorrosInteresesaFuturo.LocalReport.SetParameters(lstParametros);
            rptAhorrosInteresesaFuturo.LocalReport.Refresh();
        }
Exemplo n.º 12
0
        public frmRecibo(string nome, string CNPJ, string endereco, string cidade, string estado, string pais, string DtInicio, string DtEncerramento, string IDFinalizacao, string valor, string finalidade, string relatorio)
        {
            InitializeComponent();

            //setar o arquivo rtlc

            rpvRecibo.LocalReport.ReportEmbeddedResource = "Recibo.Recibo.rdlc";

            // setar os parametros

            Microsoft.Reporting.WinForms.ReportParameter[] p =
                new Microsoft.Reporting.WinForms.ReportParameter[12];
            p[0]  = new Microsoft.Reporting.WinForms.ReportParameter("nome", nome);
            p[1]  = new Microsoft.Reporting.WinForms.ReportParameter("CNPJ", CNPJ);
            p[2]  = new Microsoft.Reporting.WinForms.ReportParameter("endereco", endereco);
            p[3]  = new Microsoft.Reporting.WinForms.ReportParameter("cidade", cidade);
            p[4]  = new Microsoft.Reporting.WinForms.ReportParameter("estado", estado);
            p[5]  = new Microsoft.Reporting.WinForms.ReportParameter("pais", pais);
            p[6]  = new Microsoft.Reporting.WinForms.ReportParameter("DtInicio", DtInicio);
            p[7]  = new Microsoft.Reporting.WinForms.ReportParameter("DtEncerramento", DtEncerramento);
            p[8]  = new Microsoft.Reporting.WinForms.ReportParameter("IDFinalizacao", IDFinalizacao);
            p[9]  = new Microsoft.Reporting.WinForms.ReportParameter("valor", valor);
            p[10] = new Microsoft.Reporting.WinForms.ReportParameter("finalidade", finalidade);
            p[11] = new Microsoft.Reporting.WinForms.ReportParameter("relatorio", relatorio);
            rpvRecibo.LocalReport.SetParameters(p);
        }
Exemplo n.º 13
0
        private void frmRptActaNotas_Load(object sender, EventArgs e)
        {
            ReportDataSource rds  = new ReportDataSource("dsListening", dtListening);
            ReportDataSource rds2 = new ReportDataSource("dsReading", dtReading);
            ReportDataSource rds3 = new ReportDataSource("dsWriting", dtWriting);
            ReportDataSource rds4 = new ReportDataSource("dsSpeaking", dtSpeaking);
            ReportDataSource rds5 = new ReportDataSource("dsUseOfEnglish", dtUseOfEnglish);
            ReportDataSource rds6 = new ReportDataSource("dsAlumnos", dtAlumnos);
            ReportDataSource rds7 = new ReportDataSource("dsPromedios", dtPromedios);

            Microsoft.Reporting.WinForms.ReportParameter[] para = new Microsoft.Reporting.WinForms.ReportParameter[]
            {
                new Microsoft.Reporting.WinForms.ReportParameter("pIdioma", idioma),
                new Microsoft.Reporting.WinForms.ReportParameter("pNivel", nivel),
                new Microsoft.Reporting.WinForms.ReportParameter("pCiclo", ciclo),
                new Microsoft.Reporting.WinForms.ReportParameter("pAno", ano),
                new Microsoft.Reporting.WinForms.ReportParameter("pMes", mes),
                new Microsoft.Reporting.WinForms.ReportParameter("pDocente", docente),
                new Microsoft.Reporting.WinForms.ReportParameter("pNumero", numero),
                new Microsoft.Reporting.WinForms.ReportParameter("pInicio", inicio),
                new Microsoft.Reporting.WinForms.ReportParameter("pFin", fin),
            };
            this.reportViewer1.LocalReport.SetParameters(para);
            this.reportViewer1.LocalReport.DataSources.Add(rds);
            this.reportViewer1.LocalReport.DataSources.Add(rds2);
            this.reportViewer1.LocalReport.DataSources.Add(rds3);
            this.reportViewer1.LocalReport.DataSources.Add(rds4);
            this.reportViewer1.LocalReport.DataSources.Add(rds5);
            this.reportViewer1.LocalReport.DataSources.Add(rds6);
            this.reportViewer1.LocalReport.DataSources.Add(rds7);
            this.reportViewer1.RefreshReport();
        }
Exemplo n.º 14
0
        //in use
        private void Summary_Load(object sender, EventArgs e)
        {
            // set list as the dataSource named "ds" in RP
            reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("ds", list));
            string msum = Food.formatPrice(sum);

            Microsoft.Reporting.WinForms.ReportParameter[] paras = new Microsoft.Reporting.WinForms.ReportParameter[]
            {
                new Microsoft.Reporting.WinForms.ReportParameter("rSum", msum),
                new Microsoft.Reporting.WinForms.ReportParameter("rDate", DateTime.Now.ToString("dd-MM-yy hh:mm")),
                new Microsoft.Reporting.WinForms.ReportParameter("rStaff", staff),
                new ReportParameter("rNum", Num.ToString())
            };

            reportViewer1.LocalReport.SetParameters(paras);
            //reportViewer1.PrinterSettings.PrinterName = "Foxit Reader PDF Printer";
            reportViewer1.PrinterSettings.MaximumPage = 1;
            reportViewer1.PrinterSettings.ToPage      = 1;
            //reportViewer1.PrinterSettings.PrintRange = PrintRange.CurrentPage;

            //reportViewer1.RefreshReport();
            ////Controls.Add(reportViewer2);
            //this.reportViewer1.PrinterSettings.PrinterName = "Foxit Reader PDF Printer";
            //this.reportViewer1.PrinterSettings.MaximumPage = 2;
            //this.reportViewer1.PrinterSettings.FromPage = 1;
            //this.reportViewer1.PrinterSettings.ToPage = 1;
            this.reportViewer1.RefreshReport();
        }
Exemplo n.º 15
0
 public void LoadReport()
 {
     try
     {
         this.reportViewer1.LocalReport.EnableExternalImages    = true;
         this.stp_IncomeStatementResultBindingSource.DataSource = (new Taxi_Model.TaxiDataContext().stp_IncomeStatement()).ToList();
         Microsoft.Reporting.WinForms.ReportParameter[] param = new Microsoft.Reporting.WinForms.ReportParameter[1];
         string heading = string.Empty;
         //heading = "From: "+string.Format("{0:dd/MM/yyyy}", dtFrom) + " To: " + string.Format("{0:dd/MM/yyyy}", dtTill);
         string EndDate = string.Format("{0:dd/MM/yyyy}", DateTime.Now);
         //string To = string.Format("{0:dd/MM/yyyy}", dtTill);
         param[0] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_EndDate", EndDate);
         //List<ClsLogo> objLogo = new List<ClsLogo>();
         //objLogo.Add(new ClsLogo { ImageInBytes = AppVars.objSubCompany.CompanyLogo != null ? AppVars.objSubCompany.CompanyLogo.ToArray() : null });
         //ReportDataSource imageDataSource = new ReportDataSource("Taxi_AppMain_Classes_ClsLogo", objLogo);
         //this.reportViewer1.LocalReport.DataSources.Add(imageDataSource);
         reportViewer1.LocalReport.SetParameters(param);
         this.reportViewer1.ZoomPercent = 100;
         this.reportViewer1.ZoomMode    = Microsoft.Reporting.WinForms.ZoomMode.Percent;
         this.reportViewer1.RefreshReport();
     }
     catch (Exception ex)
     {
         ENUtils.ShowMessage(ex.Message);
     }
 }
Exemplo n.º 16
0
        private void frmRptFichaMatricula_Load(object sender, EventArgs e)
        {
            ReportDataSource rds = new ReportDataSource("dsImagenesDelAlumnado", dtfoto);

            Microsoft.Reporting.WinForms.ReportParameter[] para = new Microsoft.Reporting.WinForms.ReportParameter[] {
                new Microsoft.Reporting.WinForms.ReportParameter("pApellidos", _apellidos),
                new Microsoft.Reporting.WinForms.ReportParameter("pNombres", _nombres),
                new Microsoft.Reporting.WinForms.ReportParameter("pDNI", _dni),
                new Microsoft.Reporting.WinForms.ReportParameter("pSexo", _sexo),
                new Microsoft.Reporting.WinForms.ReportParameter("pFechaNacimiento", _fechanacimiento),
                new Microsoft.Reporting.WinForms.ReportParameter("pEdad", _edad),
                new Microsoft.Reporting.WinForms.ReportParameter("pGradoInstruccion", _gradoinstruccion),
                new Microsoft.Reporting.WinForms.ReportParameter("pTelefono", _telefono),
                new Microsoft.Reporting.WinForms.ReportParameter("pCelular", _celular),
                new Microsoft.Reporting.WinForms.ReportParameter("pCorreo", _correo),
                new Microsoft.Reporting.WinForms.ReportParameter("pDireccion", _direccion),
                new Microsoft.Reporting.WinForms.ReportParameter("pDistrito", _distrito),
                new Microsoft.Reporting.WinForms.ReportParameter("pProvincia", _provincia),
                new Microsoft.Reporting.WinForms.ReportParameter("pDepartamento", _departamento),
                new Microsoft.Reporting.WinForms.ReportParameter("pIdioma", _idioma),
                new Microsoft.Reporting.WinForms.ReportParameter("pNivel", _nivel),
                new Microsoft.Reporting.WinForms.ReportParameter("pCiclo", _ciclo),
                new Microsoft.Reporting.WinForms.ReportParameter("pFecha", _fecha),
                new Microsoft.Reporting.WinForms.ReportParameter("pResponsable", _resposable),
                new Microsoft.Reporting.WinForms.ReportParameter("pNumeroRecibo", _numerorecibo),
                new Microsoft.Reporting.WinForms.ReportParameter("pMonto", _monto),
                new Microsoft.Reporting.WinForms.ReportParameter("pModalidad", _modalidad),
                new Microsoft.Reporting.WinForms.ReportParameter("pCodigoAlumno", _codigoAlumno),
                new Microsoft.Reporting.WinForms.ReportParameter("pHorarioRef", _horarioRef)
            };
            this.FICHAMATRICULARPT.LocalReport.SetParameters(para);
            this.FICHAMATRICULARPT.LocalReport.DataSources.Add(rds);
            this.FICHAMATRICULARPT.LocalReport.DisplayName = _apellidos + " " + _nombres;
            this.FICHAMATRICULARPT.RefreshReport();
        }
Exemplo n.º 17
0
        public Print(string y, string s, string t, string m, string ttm, string tbm, string tam, string tt, string ttamount)
        {
            try {
                InitializeComponent();
                reportViewer2.Visible = false;

                Microsoft.Reporting.WinForms.ReportParameter[] para = new Microsoft.Reporting.WinForms.ReportParameter[]
                {
                    new Microsoft.Reporting.WinForms.ReportParameter("Year", y),
                    new Microsoft.Reporting.WinForms.ReportParameter("Subject", s),
                    new Microsoft.Reporting.WinForms.ReportParameter("tcName", t),
                    new Microsoft.Reporting.WinForms.ReportParameter("Month", m),
                    new Microsoft.Reporting.WinForms.ReportParameter("ThisM", ttm),
                    new Microsoft.Reporting.WinForms.ReportParameter("BeforeM", tbm),
                    new Microsoft.Reporting.WinForms.ReportParameter("AfterM", tam),
                    new Microsoft.Reporting.WinForms.ReportParameter("Total", tt),
                    new Microsoft.Reporting.WinForms.ReportParameter("TotalAmount", ttamount)
                };
                this.reportViewer1.LocalReport.SetParameters(para);
                this.reportViewer1.RefreshReport();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 18
0
        private void FrmCartaCorrecao_Load(object sender, EventArgs e)
        {
            try
            {
                string[] Lista_Arquivos = Directory.GetFiles(BmsSoftware.ConfigSistema1.Default.PathInstall + @"\nfe\arquivos\CCe");
                string   ArquivoCCe     = string.Empty;

                if (Lista_Arquivos.Length > 0)
                {
                    foreach (string Arquivo in Lista_Arquivos)
                    {
                        int pos = Arquivo.IndexOf(ChaveNFe);
                        if (pos != -1)
                        {
                            ArquivoCCe = Arquivo.ToString();
                            GeraDsProd(ArquivoCCe);
                        }
                    }
                }


                if (ArquivoCCe.Trim() != string.Empty)
                {
                    //setando os parametro
                    Microsoft.Reporting.WinForms.ReportParameter[] p = new Microsoft.Reporting.WinForms.ReportParameter[15];
                    p[0]  = new Microsoft.Reporting.WinForms.ReportParameter("OrgaoRecepcaoEvento", _OrgaoRecepcaoEvento);
                    p[1]  = new Microsoft.Reporting.WinForms.ReportParameter("Ambiente", _Ambiente);
                    p[2]  = new Microsoft.Reporting.WinForms.ReportParameter("Versao", _Versao);
                    p[3]  = new Microsoft.Reporting.WinForms.ReportParameter("AutorEventoCNPJ_CPF", _AutorEventoCNPJ_CPF);
                    p[4]  = new Microsoft.Reporting.WinForms.ReportParameter("ChaveAceso", _ChaveAceso);
                    p[5]  = new Microsoft.Reporting.WinForms.ReportParameter("DataEvento", _DataEvento);
                    p[6]  = new Microsoft.Reporting.WinForms.ReportParameter("TipoEvento", _TipoEvento);
                    p[7]  = new Microsoft.Reporting.WinForms.ReportParameter("SequencialEvento", _SequencialEvento);
                    p[8]  = new Microsoft.Reporting.WinForms.ReportParameter("DescricaoEvento", _DescricaoEvento);
                    p[9]  = new Microsoft.Reporting.WinForms.ReportParameter("TextoCartaCorrecao", _TextoCartaCorrecao);
                    p[10] = new Microsoft.Reporting.WinForms.ReportParameter("MensagemAutorizacao", _MensagemAutorizacao);
                    p[11] = new Microsoft.Reporting.WinForms.ReportParameter("Protocolo", _Protocolo);
                    p[12] = new Microsoft.Reporting.WinForms.ReportParameter("DataHoraAutorizacao", _DataHoraAutorizacao);
                    p[13] = new Microsoft.Reporting.WinForms.ReportParameter("CondicoesUsoCartaCorrecao", _CondicoesUsoCartaCorrecao);
                    p[14] = new Microsoft.Reporting.WinForms.ReportParameter("VerEvento", _VerEvento);

                    reportViewer1.LocalReport.SetParameters(p);

                    this.reportViewer1.SetDisplayMode(DisplayMode.PrintLayout);
                    this.reportViewer1.ZoomMode = ZoomMode.Percent;
                    this.reportViewer1.RefreshReport();
                }
                else
                {
                    MessageBox.Show("Arquivo XML da carta de correção não encontrado!");
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro técnico: " + ex.Message);
            }
        }
Exemplo n.º 19
0
        public Form2(string nome, string filiacao, string ede, string nascimento, string estadoCivil, string nacionalidade, string natural, string provincia, string residencia, string bilhete, string contacto, string correio, string classemedio, string cursomedio, string escolamedio, string fimMedio, string cursoespecialidade1, string cursoespecialidade2, string cursoespecialidade3, string cursoescolaespecialidade1, string cursoescolaespecialidade2, string cursoescolaespecialidade3, string competencia1, string competencia2, string competencia3, string comotrabalhou1, string comotrabalhou2, string comotrabalhou3, string ondetrabalhou1, string ondetrabalhou2, string ondetrabalhou3, string anoinicio1, string anoinicio2, string anoinicio3, string anofim1, string anofim2, string anofim3, string idioma1, string idioma2, string objectivo)
        {
            InitializeComponent();

            reportViewer1.LocalReport.DataSources.Clear();
            reportViewer1.LocalReport.ReportEmbeddedResource = "VitaeUi.visualizar.rdlc";
            Microsoft.Reporting.WinForms.ReportParameter[] p = new
                                                               Microsoft.Reporting.WinForms.ReportParameter[40];

            p[0]  = new Microsoft.Reporting.WinForms.ReportParameter("Nome", nome);
            p[1]  = new Microsoft.Reporting.WinForms.ReportParameter("Filiacao", filiacao);
            p[2]  = new Microsoft.Reporting.WinForms.ReportParameter("Ede", ede);
            p[3]  = new Microsoft.Reporting.WinForms.ReportParameter("Nascimento", nascimento);
            p[4]  = new Microsoft.Reporting.WinForms.ReportParameter("EstadoCivil", estadoCivil);
            p[5]  = new Microsoft.Reporting.WinForms.ReportParameter("Nacionalidade", nacionalidade);
            p[6]  = new Microsoft.Reporting.WinForms.ReportParameter("Natural", natural);
            p[7]  = new Microsoft.Reporting.WinForms.ReportParameter("Provincia", provincia);
            p[8]  = new Microsoft.Reporting.WinForms.ReportParameter("Residencia", residencia);
            p[9]  = new Microsoft.Reporting.WinForms.ReportParameter("Bilhete", bilhete);
            p[10] = new Microsoft.Reporting.WinForms.ReportParameter("Contacto", contacto);
            p[11] = new Microsoft.Reporting.WinForms.ReportParameter("Correio", correio);
            p[12] = new Microsoft.Reporting.WinForms.ReportParameter("ClasseMedio", classemedio);
            p[13] = new Microsoft.Reporting.WinForms.ReportParameter("CursoMedio", cursomedio);
            p[14] = new Microsoft.Reporting.WinForms.ReportParameter("EscolaMedio", escolamedio);
            p[15] = new Microsoft.Reporting.WinForms.ReportParameter("FimMedio", fimMedio);
            p[16] = new Microsoft.Reporting.WinForms.ReportParameter("CursoEspecialidade1", cursoescolaespecialidade1);
            p[17] = new Microsoft.Reporting.WinForms.ReportParameter("CursoEspecialidade2", cursoespecialidade2);
            p[18] = new Microsoft.Reporting.WinForms.ReportParameter("CursoEspecialidade3", cursoespecialidade3);
            p[19] = new Microsoft.Reporting.WinForms.ReportParameter("CursoEscolaEspecialidade1", cursoescolaespecialidade1);

            p[20] = new Microsoft.Reporting.WinForms.ReportParameter("CursoEscolaEspecialidade2", cursoescolaespecialidade2);

            p[21] = new Microsoft.Reporting.WinForms.ReportParameter("CursoEscolaEspecialidade3", cursoescolaespecialidade3);
            p[22] = new Microsoft.Reporting.WinForms.ReportParameter("Competencia1", competencia1);
            p[23] = new Microsoft.Reporting.WinForms.ReportParameter("Competencia2", competencia2);
            p[24] = new Microsoft.Reporting.WinForms.ReportParameter("Competencia3", competencia3);
            p[25] = new Microsoft.Reporting.WinForms.ReportParameter("ComoTrabalhou1", comotrabalhou1);
            p[26] = new Microsoft.Reporting.WinForms.ReportParameter("OndeTrabalhou1", ondetrabalhou1);
            p[27] = new Microsoft.Reporting.WinForms.ReportParameter("AnoInicio1", anoinicio1);
            p[28] = new Microsoft.Reporting.WinForms.ReportParameter("FimAno1", anofim1);

            p[29] = new Microsoft.Reporting.WinForms.ReportParameter("ComoTrabalhou2", comotrabalhou2);
            p[30] = new Microsoft.Reporting.WinForms.ReportParameter("OndeTrabalhou2", ondetrabalhou2);
            p[31] = new Microsoft.Reporting.WinForms.ReportParameter("AnoInicio2", anoinicio2);
            p[32] = new Microsoft.Reporting.WinForms.ReportParameter("FimAno2", anofim2);

            p[33] = new Microsoft.Reporting.WinForms.ReportParameter("ComoTrabalhou3", comotrabalhou3);
            p[34] = new Microsoft.Reporting.WinForms.ReportParameter("OndeTrabalhou3", ondetrabalhou3);
            p[35] = new Microsoft.Reporting.WinForms.ReportParameter("AnoInicio3", anoinicio3);
            p[36] = new Microsoft.Reporting.WinForms.ReportParameter("FimAno3", anofim3);
            p[37] = new Microsoft.Reporting.WinForms.ReportParameter("Idioma1", idioma1);
            p[38] = new Microsoft.Reporting.WinForms.ReportParameter("Idioma2", idioma2);
            p[39] = new Microsoft.Reporting.WinForms.ReportParameter("Objectivo", objectivo);
            reportViewer1.LocalReport.SetParameters(p);

            reportViewer1.LocalReport.Refresh();
            reportViewer1.RefreshReport();
        }
Exemplo n.º 20
0
        public void GenerateReport()
        {
            try
            {
                reportViewer1.LocalReport.EnableExternalImages = true;

                Microsoft.Reporting.WinForms.ReportParameter[] param = new Microsoft.Reporting.WinForms.ReportParameter[4];



                param[0] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_Header", AppVars.objSubCompany.CompanyName.ToStr());

                param[1] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_Address", AppVars.objSubCompany.Address.ToStr());

                param[2] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_Telephone", AppVars.objSubCompany.TelephoneNo.ToStr());
                param[3] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_Criteria", this.Criteria);



                //List<ClsLogo> objLogo = new List<ClsLogo>();
                //objLogo.Add(new ClsLogo { ImageInBytes = AppVars.objSubCompany.CompanyLogo != null ? AppVars.objSubCompany.CompanyLogo.ToArray() : null });
                //ReportDataSource imageDataSource = new ReportDataSource("Taxi_AppMain_Classes_ClsLogo", objLogo);
                //this.reportViewer1.LocalReport.DataSources.Add(imageDataSource);

                //string path = @"File:";
                //param[10] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_Path", path);
                //param[11] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_CompanyHeader", AppVars.objSubCompany.CompanyName.ToStr());



                reportViewer1.LocalReport.SetParameters(param);


                //int cnt = this.DataSource.Count;

                //int minRows = 8;

                //if (cnt < minRows)
                //{
                //    for (int i = 0; i < minRows - cnt; i++)
                //    {
                //        this.DataSource.Add(new vw_DriverInfo { Id = data.Id, CompanyId = data.CompanyId });
                //    }
                //}

                var list2 = (this.DataSource.AsEnumerable().OrderBy(item => item.DriverNo, new NaturalSortComparer <string>())).ToList();
                this.vu_SinBinBindingSource.DataSource = list2;//this.DataSource;

                this.reportViewer1.ZoomPercent = 100;
                this.reportViewer1.ZoomMode    = Microsoft.Reporting.WinForms.ZoomMode.Percent;
                this.reportViewer1.RefreshReport();
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
Exemplo n.º 21
0
        public void LoadReport()
        {
            try
            {
                this.reportViewer1.LocalReport.EnableExternalImages = true;
                int TotalJobs = 0;

                var list = (from a in new TaxiDataContext().stp_JobStatistics(FromPostCode, ToPostCode, FromLocId, ToLocId, FromZoneId, ToZoneId, dtFrom, dtTill)
                            select new stp_JobStatisticsResult
                {
                    BookingNo = a.BookingNo,
                    PickupDateTime = a.PickupDateTime,
                    FromAddress = a.FromAddress,
                    ToAddress = a.ToAddress,
                    DriverName = a.DriverName,
                    VehicleType = a.VehicleType,
                    StatusName = a.StatusName
                }).ToList();
                this.stp_JobStatisticsResultBindingSource.DataSource = list;
                TotalJobs = list.Count();

                Microsoft.Reporting.WinForms.ReportParameter[] param = new Microsoft.Reporting.WinForms.ReportParameter[2];

                string address = AppVars.objSubCompany.Address;
                string telNo   = "Tel No. " + AppVars.objSubCompany.TelephoneNo;
                string heading = string.Empty;
                if (dtFrom != null && dtTill != null)
                {
                    heading = string.Format("{0:dd/MM/yy}", dtFrom) + " to " + string.Format("{0:dd/MM/yy}", dtTill);
                }


                param[0] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_JobTillDate", heading);
                param[1] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_TotalJobs", "Total Jobs : " + TotalJobs.ToStr());

                //param[2] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_2", telNo);
                //param[3] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_3", AppVars.objSubCompany.CompanyName.ToStr());

                List <ClsLogo> objLogo = new List <ClsLogo>();
                objLogo.Add(new ClsLogo {
                    ImageInBytes = AppVars.objSubCompany.CompanyLogo != null ? AppVars.objSubCompany.CompanyLogo.ToArray() : null
                });
                ReportDataSource imageDataSource = new ReportDataSource("Taxi_AppMain_Classes_ClsLogo", objLogo);
                this.reportViewer1.LocalReport.DataSources.Add(imageDataSource);
                reportViewer1.LocalReport.SetParameters(param);



                this.reportViewer1.ZoomPercent = 100;
                this.reportViewer1.ZoomMode    = Microsoft.Reporting.WinForms.ZoomMode.Percent;
                this.reportViewer1.RefreshReport();
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
Exemplo n.º 22
0
        public void ShowReports(string strWinTitle, string strReportName, string[] strParams, string[] strParaVals, DataSet dsDataSource, bool blSetInit)
        {
            if (blSetInit || string.IsNullOrEmpty(reportViewer1.LocalReport.ReportPath))
            {
                SetInial(strWinTitle, strReportName);
            }

            AddRpParameterItem(strParams, strParaVals);

            if (dtRpara != null && dtRpara.Rows.Count > 0)
            {
                Microsoft.Reporting.WinForms.ReportParameter[] RParameters = new Microsoft.Reporting.WinForms.ReportParameter[dtRpara.Rows.Count];
                for (int i = 0; i < dtRpara.Rows.Count; i++)
                {
                    RParameters[i] = new Microsoft.Reporting.WinForms.ReportParameter();
                    Microsoft.Reporting.WinForms.ReportParameter RParameterItem = new Microsoft.Reporting.WinForms.ReportParameter();
                    RParameterItem.Name = dtRpara.Rows[i]["RP_KEY"].ToString();
                    RParameterItem.Values.Add(dtRpara.Rows[i]["RP_VAL"].ToString());
                    RParameters[i] = RParameterItem;
                }
                this.reportViewer1.LocalReport.SetParameters(RParameters);
            }
            if (dsDataSource != null)
            {
                if (dsDataSource.Tables.Count > 0)
                {
                    if (dsDataSource.Tables[dsDataSource.Tables.Count - 1].Columns.IndexOf("RPTDSNME") != -1)
                    {
                        string   strDsNme  = dsDataSource.Tables[dsDataSource.Tables.Count - 1].Rows[0]["RPTDSNME"].ToString();
                        string[] strDsNmes = strDsNme.Split(",".ToCharArray());
                        for (int i = 0; i < strDsNmes.Length; i++)
                        {
                            dsDataSource.Tables[i].TableName = strDsNmes[i];
                        }
                    }
                }
                IList <string> lisDs = this.reportViewer1.LocalReport.GetDataSourceNames();
                foreach (string strds in lisDs)
                {
                    if (dsDataSource.Tables.Contains(strds))
                    {
                        if (reportViewer1.LocalReport.DataSources[strds] == null ||
                            reportViewer1.LocalReport.DataSources[strds].Value == null)
                        {
                            reportViewer1.LocalReport.DataSources.Add(new ReportDataSource(strds, dsDataSource.Tables[strds]));
                        }
                        else
                        {
                            reportViewer1.LocalReport.DataSources[strds].Value = null;
                            reportViewer1.LocalReport.DataSources[strds].Value = dsDataSource.Tables[strds];
                        }
                    }
                }
            }
            this.reportViewer1.RefreshReport();
            //this.reportViewer1.LocalReport.Refresh();
        }
Exemplo n.º 23
0
        private void btnInHD_Click(object sender, EventArgs e)
        {
            if (txtTienKhachDua.Text == "")
            {
                errorMes.BlinkRate = 100;
                errorMes.SetError(txtTienKhachDua, "Cần Nhập Tiền Khách Đưa");
                return;
            }
            if (txtTienThua.Text == "")
            {
                errorMes.BlinkRate = 100;
                errorMes.SetError(txtTienThua, "");
            }
            List <CT_HoaDon> lst = new List <CT_HoaDon>();

            lst.Clear();
            for (int i = 0; i < dataGridViewHDBH.Rows.Count - 0; i++)
            {
                CT_HoaDon cT_HoaDon = new CT_HoaDon
                {
                    TenSP         = dataGridViewHDBH.Rows[i].Cells["TenLK"].Value.ToString(),
                    SoLuong       = int.Parse(dataGridViewHDBH.Rows[i].Cells["SoLuong"].Value.ToString()),
                    DonGia        = decimal.Parse(dataGridViewHDBH.Rows[i].Cells["DonGia"].Value.ToString()),
                    KhuyenMai     = decimal.Parse(dataGridViewHDBH.Rows[i].Cells["KhuyenMai"].Value.ToString()),
                    ThanhTien     = decimal.Parse(dataGridViewHDBH.Rows[i].Cells["ThanhTien"].Value.ToString()),
                    TongThanhToan = decimal.Parse(txtTongThanhT.Text),
                    TenKH         = txtTenkH.Text,
                    DienThoai     = txtSDT.Text,
                    DiaChi        = txtDiaChi.Text,
                    TenNV         = comboBoxNV.Text,
                    NgayLap       = dateTimePickerNgayLap.Text,
                    TienKhachDua  = decimal.Parse(txtTienKhachDua.Text),
                    TienThua      = decimal.Parse(txtTienThua.Text),
                    MaHD          = txtMaHD.Text,
                };
                lst.Add(cT_HoaDon);
            }
            rs.Name  = "DataSet1";
            rs.Value = lst;

            frm_in.reportViewer1.LocalReport.DataSources.Clear();
            frm_in.reportViewer1.LocalReport.DataSources.Add(rs);
            frm_in.reportViewer1.LocalReport.ReportEmbeddedResource = "DoAnCShap.reportbc.rdlc";
            Microsoft.Reporting.WinForms.ReportParameter[] reportParameters = new Microsoft.Reporting.WinForms.ReportParameter[]
            {
                new Microsoft.Reporting.WinForms.ReportParameter("ParameterSDT", frm_Setting.txtSDT.Text, true),
                new Microsoft.Reporting.WinForms.ReportParameter("ParameterWebsite", frm_Setting.txtWebSite.Text, true),
                new Microsoft.Reporting.WinForms.ReportParameter("ParameterHotLine", frm_Setting.txtHotLine.Text, true),
                new Microsoft.Reporting.WinForms.ReportParameter("ParameterDiaChi", frm_Setting.txtDiaChi.Text, true),
            };
            frm_in.reportViewer1.LocalReport.SetParameters(reportParameters);
            this.frm_in.reportViewer1.RefreshReport();
            frm_in.ShowDialog();

            XuLyChucNang(true, false);
        }
        public void LoadReport(DateTime?dtFrom, DateTime?dtTill, int Id, string ControllerName)
        {
            try
            {
                ReInitializeReportViewer();
                //string reportPath = "Taxi_AppMain.ReportDesigns.";

                if (chkSplitByController.Checked)
                {
                    this.AdminActivity.LocalReport.ReportEmbeddedResource = "Taxi_AppMain.ReportDesigns.rptActivityLogSplitByName.rdlc";
                }
                else
                {
                    this.AdminActivity.LocalReport.ReportEmbeddedResource = "Taxi_AppMain.ReportDesigns.rptActivityLog.rdlc";
                }
                this.AdminActivity.LocalReport.EnableExternalImages = true;
                this.stp_ActivityLogResultBindingSource.DataSource  = (from a in new Taxi_Model.TaxiDataContext().stp_ActivityLog(dtFrom, dtTill, Id, ControllerName)
                                                                       select new stp_ActivityLogResult
                {
                    UserId = a.UserId,
                    UserName = a.UserName,
                    ActivityDescription = a.ActivityDescription,
                    ActivityDateTime = a.ActivityDateTime
                }).ToList();



                Microsoft.Reporting.WinForms.ReportParameter[] param = new Microsoft.Reporting.WinForms.ReportParameter[1];

                // string address = AppVars.objSubCompany.Address;
                // string telNo = "Tel No. " + AppVars.objSubCompany.TelephoneNo;
                string heading = string.Empty;
                heading = "For the period of " + string.Format("{0:dd/MM/yy}", dtFrom) + " to " + string.Format("{0:dd/MM/yy}", dtTill);



                param[0] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_Period", heading);

                List <ClsLogo> objLogo = new List <ClsLogo>();
                objLogo.Add(new ClsLogo {
                    ImageInBytes = AppVars.objSubCompany.CompanyLogo != null ? AppVars.objSubCompany.CompanyLogo.ToArray() : null
                });
                ReportDataSource imageDataSource = new ReportDataSource("Taxi_AppMain_Classes_ClsLogo", objLogo);
                this.AdminActivity.LocalReport.DataSources.Add(imageDataSource);
                AdminActivity.LocalReport.SetParameters(param);

                this.AdminActivity.ZoomPercent = 100;
                this.AdminActivity.ZoomMode    = Microsoft.Reporting.WinForms.ZoomMode.Percent;
                this.AdminActivity.RefreshReport();
                IsReportLoaded = true;
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
Exemplo n.º 25
0
        public void Imprimir()
        {
            try
            {
                System.Data.DataTable dtReporte = new System.Data.DataTable();
                ObservableCollection <Infrastructure.Aspect.DataAccess.DataAccessFilterSQL> _listFilters = new ObservableCollection <Infrastructure.Aspect.DataAccess.DataAccessFilterSQL>();
                _listFilters.Add(new Infrastructure.Aspect.DataAccess.DataAccessFilterSQL()
                {
                    FilterName = "@psinEMPR_Codigo", FilterValue = Delfin.Controls.Entorno.ItemEmpresa.EMPR_Codigo, FilterType = Infrastructure.Aspect.DataAccess.DataAccessFilterTypes.Int16, FilterSize = 2
                });
                //_listFilters.Add(new Infrastructure.Aspect.DataAccess.DataAccessFilterSQL() { FilterName = "@pchrCUBA_Codigo", FilterValue = F_CUBA_Codigo, FilterType = Infrastructure.Aspect.DataAccess.DataAccessFilterTypes.Char, FilterSize = 3 });
                _listFilters.Add(new Infrastructure.Aspect.DataAccess.DataAccessFilterSQL()
                {
                    FilterName = "@FecIni", FilterValue = F_FecIni, FilterType = Infrastructure.Aspect.DataAccess.DataAccessFilterTypes.DateTime, FilterSize = 8
                });
                _listFilters.Add(new Infrastructure.Aspect.DataAccess.DataAccessFilterSQL()
                {
                    FilterName = "@FecFin", FilterValue = F_FecFin, FilterType = Infrastructure.Aspect.DataAccess.DataAccessFilterTypes.DateTime, FilterSize = 8
                });
                //_listFilters.Add(new Infrastructure.Aspect.DataAccess.DataAccessFilterSQL() { FilterName = "@pchrMOVI_EstadoCheque", FilterValue = F_MOVI_EstadoCheque, FilterType = Infrastructure.Aspect.DataAccess.DataAccessFilterTypes.Char, FilterSize = 1 });
                //_listFilters.Add(new Infrastructure.Aspect.DataAccess.DataAccessFilterSQL() { FilterName = "@TipoCheque", FilterValue = F_TipoCheque, FilterType = Infrastructure.Aspect.DataAccess.DataAccessFilterTypes.Char, FilterSize = 1 });

                dtReporte = Client.GetDTCuentasBancarias("CAJ_REPOSS_Cheques", _listFilters);

                if (dtReporte != null && dtReporte.Rows.Count > 0)
                {
                    String ReportPath = null;
                    dtReporte.TableName = "DSDetalle";
                    ReportPath          = Application.StartupPath + @"\Reportes\REP002Cheques.rdlc";
                    ReportDataSource RepDetalle = new ReportDataSource("DSDetalle", dtReporte);

                    Microsoft.Reporting.WinForms.ReportParameter[] Parameters = new Microsoft.Reporting.WinForms.ReportParameter[8];

                    String _fecha = Fecha.ToString("dd/MM/yyyy HH:mm");
                    Parameters[0] = new Microsoft.Reporting.WinForms.ReportParameter("Titulo", Title);
                    Parameters[1] = new Microsoft.Reporting.WinForms.ReportParameter("FechaHora", _fecha);
                    Parameters[2] = new Microsoft.Reporting.WinForms.ReportParameter("CuentaCorriente", "-");
                    Parameters[3] = new Microsoft.Reporting.WinForms.ReportParameter("FechaDesde", F_FecIni.Value.ToString("dd/MM/yyyy"));
                    Parameters[4] = new Microsoft.Reporting.WinForms.ReportParameter("FechaHasta", F_FecFin.Value.ToString("dd/MM/yyyy"));
                    Parameters[5] = new Microsoft.Reporting.WinForms.ReportParameter("Estado", "-");
                    Parameters[6] = new Microsoft.Reporting.WinForms.ReportParameter("EntidadBancaria", "-");
                    Parameters[7] = new Microsoft.Reporting.WinForms.ReportParameter("Tipo", "-");

                    Visualizador rpt = new Visualizador("Reporte de Cheques", ReportPath, RepDetalle, Parameters);
                    rpt.StartPosition = FormStartPosition.CenterScreen;
                    rpt.Imprimir();
                    rpt.ShowDialog();
                }
                else
                {
                    Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeInformacion(Title, "No se encontraron registros");
                }
            }
            catch (Exception)
            { throw; }
        }
Exemplo n.º 26
0
        private void LoadReceipt(string No)
        {
            reportViewer1.LocalReport.DataSources.Clear();

            Orders   v = new Orders();
            Customer c = new Customer();
            Company  y = new Company();

            v = Orders.SelectNo(No);
            y = Company.Select();
            /**Company Customer***/

            Microsoft.Reporting.WinForms.ReportParameter rp = new Microsoft.Reporting.WinForms.ReportParameter("image", Helper.CompanyImage);
            this.reportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WinForms.ReportParameter[] { rp });

            MySQL.Close();
            MySql.Data.MySqlClient.MySqlDataAdapter da = new MySql.Data.MySqlClient.MySqlDataAdapter("SELECT * FROM orders WHERE no='" + No + "'", MySQL.Conn);
            DataSet ds = new DataSet();

            da.Fill(ds);

            MySql.Data.MySqlClient.MySqlDataAdapter da2 = new MySql.Data.MySqlClient.MySqlDataAdapter("SELECT * FROM customer WHERE id='" + v.CustomerID + "'", MySQL.Conn);
            DataSet ds2 = new DataSet();

            da2.Fill(ds2);

            MySql.Data.MySqlClient.MySqlDataAdapter da3 = new MySql.Data.MySqlClient.MySqlDataAdapter("SELECT product.name AS itemID ,product.code AS self,product.description AS tax,casetransaction.cost,casetransaction.date as date,casetransaction.no as no,casetransaction.total as total,casetransaction.qty as qty,casetransaction.cost,casetransaction.created,casetransaction.sync,casetransaction.height,casetransaction.limits,casetransaction.weight,casetransaction.setting,casetransaction.instruction,casetransaction.period FROM casetransaction LEFT join product ON casetransaction.itemID = product.id  WHERE casetransaction.no='" + No + "'", MySQL.Conn);
            DataSet ds3 = new DataSet();

            da3.Fill(ds3);


            MySql.Data.MySqlClient.MySqlDataAdapter da4 = new MySql.Data.MySqlClient.MySqlDataAdapter("SELECT * FROM coverage WHERE customerID='" + v.CustomerID + "'", MySQL.Conn);
            DataSet ds4 = new DataSet();

            da4.Fill(ds4);

            MySql.Data.MySqlClient.MySqlDataAdapter da5 = new MySql.Data.MySqlClient.MySqlDataAdapter("SELECT * FROM practitioner WHERE id='" + v.PractitionerID + "'", MySQL.Conn);
            DataSet ds5 = new DataSet();

            da5.Fill(ds5);


            ReportDataSource datasource  = new ReportDataSource("DataSet1", ds.Tables[0]);
            ReportDataSource datasource2 = new ReportDataSource("DataSet2", ds2.Tables[0]);
            ReportDataSource datasource3 = new ReportDataSource("DataSet3", ds3.Tables[0]);
            ReportDataSource datasource4 = new ReportDataSource("DataSet4", ds4.Tables[0]);
            ReportDataSource datasource5 = new ReportDataSource("DataSet5", ds5.Tables[0]);

            reportViewer1.LocalReport.DataSources.Add(datasource);
            reportViewer1.LocalReport.DataSources.Add(datasource2);
            reportViewer1.LocalReport.DataSources.Add(datasource3);
            reportViewer1.LocalReport.DataSources.Add(datasource4);
            reportViewer1.LocalReport.DataSources.Add(datasource5);
            reportViewer1.RefreshReport();
        }
        public void LoadReport()
        {
            try
            {
                DateTime? dtFrom = dtpFromDate.Value.ToDateorNull();
                DateTime? dtTill = dtpTillDate.Value.ToDateorNull();
                string Error = string.Empty;
                if (dtFrom == null)
                {
                    Error = "Required: From Date";
                }
                if (dtTill == null)
                {
                    if (string.IsNullOrEmpty(Error))
                    {
                        Error = "Required: To Date";
                    }
                    else
                    {
                        Error += Environment.NewLine + "Required: To Date";
                    }
                }
                if (!string.IsNullOrEmpty(Error))
                {
                    ENUtils.ShowMessage(Error);
                    return;
                }

                this.reportViewer1.LocalReport.EnableExternalImages = true;
                var list=(new Taxi_Model.TaxiDataContext().stp_GetDriverLoginHour(dtFrom,dtTill+ TimeSpan.Parse("23:59:59"))).ToList();
                var list2 = (list.AsEnumerable().OrderBy(item => item.DriverNo, new NaturalSortComparer<string>())).ToList();
                this.stp_GetDriverLoginHourResultBindingSource.DataSource = list2;

                Microsoft.Reporting.WinForms.ReportParameter[] param = new Microsoft.Reporting.WinForms.ReportParameter[1];
                string heading = string.Empty;
                heading = "For the Period " + string.Format("{0:dd/MM/yyyy}", dtFrom) + " to " + string.Format("{0:dd/MM/yyyy}", dtTill);
                //heading = "From: "+string.Format("{0:dd/MM/yyyy}", dtFrom) + " To: " + string.Format("{0:dd/MM/yyyy}", dtTill);
               // string EndDate = string.Format("{0:dd/MM/yyyy}", DateTime.Now);
                //string To = string.Format("{0:dd/MM/yyyy}", dtTill);
                param[0] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_LoginPeriod", heading);
                //List<ClsLogo> objLogo = new List<ClsLogo>();
                //objLogo.Add(new ClsLogo { ImageInBytes = AppVars.objSubCompany.CompanyLogo != null ? AppVars.objSubCompany.CompanyLogo.ToArray() : null });
                //ReportDataSource imageDataSource = new ReportDataSource("Taxi_AppMain_Classes_ClsLogo", objLogo);
                //this.reportViewer1.LocalReport.DataSources.Add(imageDataSource);
                reportViewer1.LocalReport.SetParameters(param);
                this.reportViewer1.ZoomPercent = 100;
                this.reportViewer1.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.Percent;
                this.reportViewer1.RefreshReport();
                IsReportLoaded = true;
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
Exemplo n.º 28
0
        public void LoadReport()
        {
            try
            {
                this.reportViewer1.LocalReport.EnableExternalImages = true;
                Microsoft.Reporting.WinForms.ReportParameter[] param = new Microsoft.Reporting.WinForms.ReportParameter[3];
                this.stp_GetLostPropertyResultBindingSource.DataSource = GetData(LostId);



                string Name    = AppVars.objSubCompany.CompanyName;
                string PhoneNo = "Phone No: " + AppVars.objSubCompany.TelephoneNo;
                string address = AppVars.objSubCompany.Address;
                //string telNo = "Tel No. " + AppVars.objSubCompany.TelephoneNo;
                //string heading = string.Empty;
                //if (dtFrom != null && dtTill != null)
                //{
                //heading = string.Format("{0:dd/MM/yy}", dtFrom) + " to " + string.Format("{0:dd/MM/yy}", dtTill);
                // }


                param[0] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_CompanyName", Name);
                param[1] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_CompanyAddress", address);
                param[2] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_CompanyPhoneNo", PhoneNo);
                // string address = AppVars.objSubCompany.Address;
                // string telNo = "Tel No. " + AppVars.objSubCompany.TelephoneNo;
                string heading = string.Empty;
                //if (dtFrom != null && dtTill != null)
                //{
                //heading = string.Format("{0:dd/MM/yy}", dtFrom) + " to " + string.Format("{0:dd/MM/yy}", dtTill);
                // }


                //  param[0] = new Microsoft.Reporting.WinForms.ReportParameter("Report_Parameter_Period", heading);

                List <ClsLogo> objLogo = new List <ClsLogo>();
                objLogo.Add(new ClsLogo {
                    ImageInBytes = AppVars.objSubCompany.CompanyLogo != null ? AppVars.objSubCompany.CompanyLogo.ToArray() : null
                });
                ReportDataSource imageDataSource = new ReportDataSource("Taxi_AppMain_Classes_ClsLogo", objLogo);
                this.reportViewer1.LocalReport.DataSources.Add(imageDataSource);
                reportViewer1.LocalReport.SetParameters(param);



                this.reportViewer1.ZoomPercent = 100;
                this.reportViewer1.ZoomMode    = Microsoft.Reporting.WinForms.ZoomMode.Percent;
                this.reportViewer1.RefreshReport();
            }
            catch (Exception ex)
            {
                ENUtils.ShowMessage(ex.Message);
            }
        }
Exemplo n.º 29
0
        private void FrmReciboAvulsoRelat_Load(object sender, EventArgs e)
        {
            EMPRESAProvider   EMPRESAP    = new EMPRESAProvider();
            EMPRESACollection EMPRESAColl = new EMPRESACollection();

            EMPRESAColl = EMPRESAP.ReadCollectionByParameter(null);

            //Logomarca
            CONFISISTEMAProvider CONFISISTEMAP  = new CONFISISTEMAProvider();
            CONFISISTEMAEntity   CONFISISTEMAty = CONFISISTEMAP.Read(1);

            if (CONFISISTEMAty.FLAGLOGORELATORIO == "S")
            {
                if (CONFISISTEMAty.IDARQUIVOBINARIO1 != null)
                {
                    ARQUIVOBINARIOProvider   ARQUIVOBINARIOP    = new ARQUIVOBINARIOProvider();
                    ARQUIVOBINARIOCollection ARQUIVOBINARIOColl = new ARQUIVOBINARIOCollection();
                    RowRelatorio.Clear();
                    RowRelatorio.Add(new RowsFiltro("IDARQUIVOBINARIO", "System.Int32", "=", CONFISISTEMAty.IDARQUIVOBINARIO1.ToString()));
                    ARQUIVOBINARIOColl = ARQUIVOBINARIOP.ReadCollectionByParameter(RowRelatorio);
                    this.ARQUIVOBINARIOCollectionBindingSource.DataSource = ARQUIVOBINARIOColl;
                }
            }


            //Dados do cliente
            //Dados do Cliente
            RowRelatorio.Clear();
            RowRelatorio.Add(new RowsFiltro("IDCLIENTE", "System.Int32", "=", CodClienteSelec.ToString()));
            LIS_CLIENTEProvider LIS_CLIENTEP = new LIS_CLIENTEProvider();

            LIS_CLIENTEColl = LIS_CLIENTEP.ReadCollectionByParameter(RowRelatorio);
            CPFCNPJSelec    = (LIS_CLIENTEColl[0].CNPJ == "  .   .   /    -" || LIS_CLIENTEColl[0].CNPJ == string.Empty) ? LIS_CLIENTEColl[0].CPF : LIS_CLIENTEColl[0].CNPJ;

            //setando os parametro
            Microsoft.Reporting.WinForms.ReportParameter[] p = new Microsoft.Reporting.WinForms.ReportParameter[6];
            p[0] = new Microsoft.Reporting.WinForms.ReportParameter("DataRecibo", DataReciboSelec);
            p[1] = new Microsoft.Reporting.WinForms.ReportParameter("ValorRecibo", ValorReciboSelec);
            p[2] = new Microsoft.Reporting.WinForms.ReportParameter("ValorExtenso", ValorExtensoSelec);
            p[3] = new Microsoft.Reporting.WinForms.ReportParameter("CPFCNPJ", CPFCNPJSelec);
            p[4] = new Microsoft.Reporting.WinForms.ReportParameter("Referente", ReferenteSelec);
            p[5] = new Microsoft.Reporting.WinForms.ReportParameter("Observacaco", ObservacacoSelec);



            reportViewer1.LocalReport.SetParameters(p);

            this.EMPRESACollectionBindingSource.DataSource     = EMPRESAColl;
            this.LIS_CLIENTECollectionBindingSource.DataSource = LIS_CLIENTEColl;

            this.reportViewer1.SetDisplayMode(DisplayMode.PrintLayout);
            this.reportViewer1.ZoomMode = ZoomMode.Percent;
            this.reportViewer1.RefreshReport();
        }
        private void gmtdMostrarReporte(DateTime tdtmFechaInial, DateTime tdtmFechaFinal, string tstrTipo)
        {
            DateTime dtmFechaActual = new blConfiguracion().gmtdCapturarFechadelServidor();;

            List <SqlParameter> lstParameters = new List <SqlParameter>();
            SqlParameter        parametro     = new SqlParameter("@dtmFechaIni", SqlDbType.DateTime);

            parametro.Value = tdtmFechaInial;
            lstParameters.Add(parametro);
            parametro       = new SqlParameter("@dtmFechaFin", SqlDbType.DateTime);
            parametro.Value = tdtmFechaFinal;
            lstParameters.Add(parametro);
            parametro       = new SqlParameter("@strTipo", SqlDbType.VarChar);
            parametro.Value = tstrTipo;
            lstParameters.Add(parametro);
            DataSet ds = new DataSet();

            ds = propiedades.ejecutarSp(lstParameters, "spClasificaciondeCreditos");

            if (tstrTipo == "01")
            {
                ReportDataSource datasource = new ReportDataSource("clasificaciondeCredito_spClasificaciondeCreditos", ds.Tables[0]);
                lstParameters = new List <SqlParameter>();
                ds            = propiedades.ejecutarSp(lstParameters, "spClasificaciondeCreditosTotalesporClasificacion");
                ReportDataSource datasource1 = new ReportDataSource("spClasificaciondeCreditosTotalesporClasificacion_spClasificaciondeCreditosTotalesporClasificacion", ds.Tables[0]);
                ds = propiedades.ejecutarSp(lstParameters, "spClasificaciondeCreditosIndicedeCarteraMorosa");
                ReportDataSource datasource2 = new ReportDataSource("spClasificaciondeCreditosIndicedeCarteraMorosa_spClasificaciondeCreditosIndicedeCarteraMorosa", ds.Tables[0]);
                ds = propiedades.ejecutarSp(lstParameters, "spClasificaciondeCreditosPorClasificaciónyLinea");
                ReportDataSource datasource3 = new ReportDataSource("spClasificaciondeCreditosPorClasificaciónyLinea_spClasificaciondeCreditosPorClasificaciónyLinea", ds.Tables[0]);

                List <Microsoft.Reporting.WinForms.ReportParameter> lstParametros    = new List <Microsoft.Reporting.WinForms.ReportParameter>();
                Microsoft.Reporting.WinForms.ReportParameter        parametroReporte = new Microsoft.Reporting.WinForms.ReportParameter("Titulo", "Clasificación de Créditos");
                lstParametros.Add(parametroReporte);

                rptProvisiondeCartera.Reset();
                rptProvisiondeCartera.Visible        = true;
                rptProvisiondeCartera.ProcessingMode = ProcessingMode.Local;
                rptProvisiondeCartera.LocalReport.DataSources.Clear();
                rptProvisiondeCartera.LocalReport.DataSources.Add(datasource);
                rptProvisiondeCartera.LocalReport.DataSources.Add(datasource1);
                rptProvisiondeCartera.LocalReport.DataSources.Add(datasource2);
                rptProvisiondeCartera.LocalReport.DataSources.Add(datasource3);
                rptProvisiondeCartera.LocalReport.ReportEmbeddedResource = "Mutuales2020.Creditos.Reportes.rptProvisiondeCartera.rdlc";
                rptProvisiondeCartera.LocalReport.SetParameters(lstParametros);
                rptProvisiondeCartera.LocalReport.Refresh();

                this.rptProvisiondeCartera.RefreshReport();
            }
            else
            {
                MessageBox.Show("Operación Realizada", "Operación", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        private IEnumerable<Microsoft.Reporting.WinForms.ReportParameter> GetParameters()
        {
            foreach(var parameterElement in CurrentReportMeta.ReportElement.ReportParameters)
            {
                var parameter = new Microsoft.Reporting.WinForms.ReportParameter(parameterElement.Name);
                var resolvedParameter = CurrentReportMeta.ReportParameters[parameter.Name];

                if (resolvedParameter.MultiValue)
                    foreach (var value in (object[])resolvedParameter.Value)
                        parameter.Values.Add(LocalReportsEngineCommon.ValueToString(value, resolvedParameter.DataType));
                else
                    parameter.Values.Add(LocalReportsEngineCommon.ValueToString(resolvedParameter.Value, resolvedParameter.DataType));

                yield return parameter;
            }
        }
Exemplo n.º 32
0
        /// <summary>
        /// Jams labels and values into two separate parameters that is extracted programatically within 
        /// the rdlc code block.
        /// </summary>
        /// <param name="reportLabelNames"></param>
        /// <param name="reportLabelValues"></param>
        private void PopulateReportLabelData(string reportLabelNames, string reportLabelValues)
        {
            try
            {
                // Set the parameter values
                Microsoft.Reporting.WinForms.ReportParameter rpParamLabels = new Microsoft.Reporting.WinForms.ReportParameter("ParamLabels", reportLabelNames);
                Microsoft.Reporting.WinForms.ReportParameter rpParamValues = new Microsoft.Reporting.WinForms.ReportParameter("ParamValues", reportLabelValues);

                // Add report parameters array
                _localReport.SetParameters(new Microsoft.Reporting.WinForms.ReportParameter[] {
                    rpParamLabels,
                    rpParamValues});
            }
            catch (Exception ex)
            {
                log.Debug(ex, ex);
                throw new Exception(String.Format(Messages.WLB_REPORT_ERROR_LOCALIZED_PARAMS, ex.Message));
            }
        }
Exemplo n.º 33
0
        private void frmRptViewer_Load(object sender, EventArgs e)
        {
            Waiting.Show("Preparing to generate report");
            try
            {
                this.Cursor = Cursors.WaitCursor;
                if (string.IsNullOrEmpty(this.strRptPath) || (this.dicDSNameWithSQL.Count == 0 && this.dicDSNameWithData.Count == 0))
                {
                    CommFunc.MsgInfo("The report path and report data should assign value!");
                    this.Close();
                }
                else
                {
                    this.rptViewer.Reset();
                    this.rptViewer.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local;
                    this.rptViewer.LocalReport.ReportPath = this.strRptPath;
                    this.rptViewer.LocalReport.DataSources.Clear();

                    if (this.dicDSNameWithSQL.Count > 0)
                    {
                        foreach (KeyValuePair<string, string> itemDs in this.dicDSNameWithSQL)
                        {
                            Microsoft.Reporting.WinForms.ReportDataSource rptDS = new Microsoft.Reporting.WinForms.ReportDataSource();
                            rptDS.Name = itemDs.Key;
                            rptDS.Value = GlobalParam.Inst.DBI.GetDataTable(itemDs.Value);
                            this.rptViewer.LocalReport.DataSources.Add(rptDS);
                        }
                    }

                    if (this.dicDSNameWithData.Count > 0)
                    {
                        foreach (KeyValuePair<string, DataTable> itemDs in this.dicDSNameWithData)
                        {
                            Microsoft.Reporting.WinForms.ReportDataSource rptDS = new Microsoft.Reporting.WinForms.ReportDataSource();
                            rptDS.Name = itemDs.Key;
                            rptDS.Value = itemDs.Value;
                            this.rptViewer.LocalReport.DataSources.Add(rptDS);
                        }
                    }

                    if (this.dicParam.Count > 0)
                    {
                        ReportParameter[] param = new ReportParameter[this.dicParam.Count];
                        int i = 0;
                        foreach (KeyValuePair<string, string> item in this.dicParam)
                        {
                            param[i] = new Microsoft.Reporting.WinForms.ReportParameter(item.Key, item.Value);
                            i += 1;
                        }

                        this.rptViewer.LocalReport.SetParameters(param);
                    }
                    this.rptViewer.RefreshReport();
                }
            }
            catch (Exception ex)
            {
                Waiting.Close();
                CommFunc.MsgErr(ex);
                this.Close();
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Exemplo n.º 34
0
        private void Form1_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'rMSDBDataSet.order_details' table. You can move, or remove it, as needed.

            CCommonConstants tempCommonConstants=ConfigManager.GetConfig<CCommonConstants>();

            DataSet1 ds = new DataSet1();

            SqlDataAdapter tempSql = new SqlDataAdapter("select category3.cat3_name \"Item\", order_details.quantity \"Qty\",category3.table_price \"Price\" from order_details,category3 where order_details.product_id=category3.cat3_id", tempCommonConstants.DBConnection);
            tempSql.Fill(ds.PaymentSlipItems);

            paymentSlipItemsBindingSource.DataSource = ds;

             //   LocalReport report = new LocalReport();

             //   report.ReportPath = @"..\..\Report1.rdlc";
             //   report.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("Items", ds.PaymentSlipItems));
            Microsoft.Reporting.WinForms.ReportParameter[] paramList=new Microsoft.Reporting.WinForms.ReportParameter[1];
            paramList[0] = new Microsoft.Reporting.WinForms.ReportParameter("CustomerName", "Sakib");
             //   report.SetParameters(paramList);
            this.reportViewer1.LocalReport.SetParameters(paramList);

            Export(this.reportViewer1.LocalReport);
            m_currentPageIndex = 0;
            Print();

            this.reportViewer1.RefreshReport();
        }