コード例 #1
0
        void RaporOnizleme(bool Disigner)
        {
            DataRow dr           = gridView1.GetDataRow(gridView1.FocusedRowHandle);
            string  pkSatislar   = dr["pkSatislar"].ToString();
            string  exedizini    = Path.GetDirectoryName(Application.ExecutablePath);
            string  RaporDosyasi = "Rapor.repx";

            //xrBarkod Barkod = new xrBarkod();
            DevExpress.XtraReports.UI.XtraReport Barkod = new DevExpress.XtraReports.UI.XtraReport();
            string sql = @"SELECT sk.pkStokKarti,sk.StokKod,sk.Stokadi,sd.Adet,sd.SatisFiyati,sd.iskontotutar,sd.iskontoyuzde,sd.Tarih FROM Satislar s 
inner join SatisDetay sd on sd.fkSatislar=s.pkSatislar
inner join StokKarti sk on sk.pkStokKarti=sd.fkStokKarti
where s.pkSatislar =" + pkSatislar;

            Barkod.DataSource = DB.GetData(sql);

            RaporDosyasi = exedizini + "\\Raporlar\\satisfisia4.repx";
            //rapor.DataSource = gCPerHareketleri.DataSource;
            //rapor.CreateDocument();
            Barkod.LoadLayout(RaporDosyasi);
            //rapor.FindControl("xlKasaAdi", true).Text = lueKasa.Text + " " + ilkdate.DateTime.ToString("dd.MM.yyyy") +
            //    "-" + sondate.DateTime.ToString("dd.MM.yyyy");
            if (Disigner)
            {
                Barkod.ShowDesignerDialog();
            }
            else
            {
                Barkod.ShowRibbonPreview();
            }
        }
コード例 #2
0
        private void frmGe_sis_reporte_Disenador_Load(object sender, EventArgs e)
        {
            try
            {
                string Rpt           = "";
                string asambly       = "";
                string nombreAsambly = "";
                if (InfoReporte != null)
                {
                    if (InfoReporte.CodReporte != null)
                    {
                        Rpt           = InfoReporte.Class_NomReporte;
                        asambly       = InfoReporte.nom_Asembly;
                        nombreAsambly = asambly + ".dll";

                        Ensamblado = Assembly.LoadFrom(nombreAsambly);

                        Object ObjFrm;
                        Type   tipo = Ensamblado.GetType(asambly + "." + Rpt);

                        if (tipo == null)
                        {
                            MessageBox.Show("No se encontró el Reporte Emsamblado:" + asambly + "  Reporte:" + Rpt, param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                        else
                        {
                            ObjFrm = Activator.CreateInstance(tipo);
                            DevExpress.XtraReports.UI.XtraReport Reporte_Para_diseño = (DevExpress.XtraReports.UI.XtraReport)ObjFrm;
                            if (Reporte_Para_diseño != null)
                            {
                                if (InfoReporte.Disenio_reporte != null)
                                {
                                    File.WriteAllBytes(RootReporte, InfoReporte.Disenio_reporte);
                                }

                                commandBarItem31.PerformClick();

                                if (InfoReporte.Disenio_reporte != null)
                                {
                                    Reporte_Para_diseño.LoadLayout(RootReporte);
                                }

                                xrDesignDockManager1.XRDesignPanel.OpenReport(Reporte_Para_diseño);
                            }
                        }
                    }
                }
                commandBarItem31.Enabled = false;
                commandBarItem32.Enabled = false;
            }
            catch (Exception ex)
            {
                string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                NameMetodo = NameMetodo + " - " + ex.ToString();
                Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
                MessageBox.Show(NameMetodo + " " + param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas)
                                , param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }