예제 #1
0
        void Form1_Load(object sender, EventArgs e)
        {
            Dashboard dashboard = new DevExpress.DashboardCommon.Dashboard();

            dashboard.LoadFromXml(@"Data\CustomerSupport.xml");
            dashboard.DataSources[0].Data =
                new CustomerSupportData(
                    DataLoader.LoadCustomerSupport(),
                    DataLoader.LoadEmployees()
                    ).CustomerSupport;
            dashboardViewer1.Dashboard = dashboard;
        }
예제 #2
0
 static DevExpress.DashboardCommon.Dashboard LoadFromXml(IDashboardDefinition dashboardDefinition) {
     var dashboard = new DevExpress.DashboardCommon.Dashboard();
     using (var me = new MemoryStream()) {
         var sw = new StreamWriter(me);
         sw.Write(dashboardDefinition.Xml);
         sw.Flush();
         me.Seek(0, SeekOrigin.Begin);
         dashboard.LoadFromXml(me);
         sw.Close();
         me.Close();
     }
     return dashboard;
 }
예제 #3
0
        static DevExpress.DashboardCommon.Dashboard LoadFromXml(IDashboardDefinition dashboardDefinition)
        {
            var dashboard = new DevExpress.DashboardCommon.Dashboard();

            using (var me = new MemoryStream()) {
                var sw = new StreamWriter(me);
                sw.Write(dashboardDefinition.Xml);
                sw.Flush();
                me.Seek(0, SeekOrigin.Begin);
                dashboard.LoadFromXml(me);
                sw.Close();
                me.Close();
            }
            return(dashboard);
        }
예제 #4
0
 static void LoadFromXml(string xml, DevExpress.DashboardCommon.Dashboard dashboard)
 {
     if (xml != null)
     {
         using (var me = new MemoryStream()) {
             var sw = new StreamWriter(me);
             sw.Write(xml);
             sw.Flush();
             me.Seek(0, SeekOrigin.Begin);
             dashboard.LoadFromXml(me);
             sw.Close();
             me.Close();
         }
     }
 }
예제 #5
0
        public S_Evraklar_Result Evrak = new S_Evraklar_Result(); //Model.S_Evraklar_Result Evrak = new Model.S_Evraklar_Result();
        public void Datagetir()
        {
            //açınca ekran kitleniyor. incelemek lazım.
            //SplashScreenManager.ShowForm(this, typeof(BarduckCRM.Bekleyiniz), true, true);
            //SplashScreenManager.CloseForm();

            Evrak = data.S_Evraklar(DashboardID, true, 1).FirstOrDefault();   //Genel.PrmDb.S_Evraklar(DashboardID, true, Genel.DilID).FirstOrDefault();

            var DosyaYolu = data.S_AyarKarakter(2, 1).FirstOrDefault().Deger; //Genel.PrmDb.S_AyarKarakter(2, Genel.DilID).FirstOrDefault().Deger;

            DosyaYolu += Evrak.DosyaAdi + ".xml";
            byte[] bytearry = data.S_DosyaGet(DosyaYolu).FirstOrDefault();
            if (bytearry == null)
            {
                //Ayar.InfoMesajGoster(Genel.DilGetirMesaj(0), Ayar.MesajTipi.Hata, this);
                return;
            }
            Stream RepData = Genel.ByteArrayToStream(bytearry);

            DevExpress.DashboardCommon.Dashboard dasboard = new DevExpress.DashboardCommon.Dashboard();
            dasboard.BeginUpdateLayout();
            dasboard.LoadFromXml(RepData);

            dasboard.DataLoading += dasboard_DataLoading;
            dasboard.EndUpdateLayout();

            //    DataSet datasourcelist = Ayar.DsGetir(DashboardID, MusteriID, ProjeID, AktiviteID, Parametre4, Parametre5, Parametre6, Parametre7, Parametre8, Parametre9, Parametre10);
            ////    dasboard.DataSources.Clear();
            //    foreach (DataTable item in datasourcelist.Tables)
            //    {
            //        dasboard.AddDataSource(item.TableName, item);
            //        //if (dasboard.DataSources.Where(z => z.Name == item.TableName).FirstOrDefault() == null)
            //        //{
            //        //    dasboard.AddDataSource(item.TableName, item);
            //        //}
            //    }

            if (dasboard != null)
            {
                dashboardViewer1.Dashboard = dasboard;

                // dashboardViewer1.PopulateUnusedDataSources = true;
                // dashboardViewer1.ReloadData();
            }
        }
예제 #6
0
        public static DevExpress.DashboardCommon.Dashboard ToDashboard(this IDashboardDefinition dashboardDefinition)
        {
            var dashboard = new DevExpress.DashboardCommon.Dashboard();

            if (!string.IsNullOrWhiteSpace(dashboardDefinition.Xml))
            {
                using (var me = new MemoryStream()){
                    var sw  = new StreamWriter(me);
                    var xml = dashboardDefinition.Xml;
                    xml = Regex.Replace(xml,
                                        $"({typeof(ParameterLessProxyCollection).FullName}, {typeof(ParameterLessProxyCollection).Namespace}, Version=)([^,]*)",
                                        "${1}" + XpandAssemblyInfo.Version, RegexOptions.IgnoreCase);
                    sw.Write(xml);
                    sw.Flush();
                    me.Seek(0, SeekOrigin.Begin);
                    dashboard.LoadFromXml(me);
                    sw.Close();
                    me.Close();
                }
            }
            return(dashboard);
        }
예제 #7
0
        private void btnTasarim_ItemClick(object sender, ItemClickEventArgs e)
        {
            //DevExpress.DashboardCommon.Dashboard dasboard = new DevExpress.DashboardCommon.Dashboard();

            //var DosyaYolu = data.S_AyarKarakter(2, 1).ToList().FirstOrDefault().Deger + "dash.xml";//gv.GetRowCellValue(iRowID, "DosyaAdi").ToString() + ".xml";
            //if (DosyaYolu == null)
            //    return;

            //byte[] bytearry = data.S_DosyaGet(DosyaYolu).FirstOrDefault();
            //if (bytearry != null)
            //{
            //    Stream RepData = Genel.ByteArrayToStream(bytearry);
            //    dasboard.LoadFromXml(RepData);
            //}



            ////DataSet datasourcelist = Ayar.DsGetir(iSelectedReportID, 1, 1, 1, 1, 1, 1, 1, 1, 1, 99, true);
            //////dasboard.DataSources.Clear();
            ////foreach (DataTable item in datasourcelist.Tables)
            ////{

            ////    if (dasboard.DataSources.Where(z => z.Name == item.TableName).FirstOrDefault() == null)
            ////    {
            ////        dasboard.AddDataSource(item.TableName, item);
            ////    }
            ////}
            ////dasboard.DataLoading += dasboard_DataLoading;

            //DashboardTasarim frm = new DashboardTasarim(dasboard);
            //frm.Show();

            #region Dashboard
            var    DosyaYolu = data.S_AyarKarakter(2, 1).FirstOrDefault().Deger + DosyaAdi + ".xml";
            byte[] bytearry  = data.S_DosyaGet(DosyaYolu).FirstOrDefault();
            if (bytearry != null)
            {
                Stream RepData = Genel.ByteArrayToStream(bytearry);
                DevExpress.DashboardCommon.Dashboard dasboard = new DevExpress.DashboardCommon.Dashboard();
                dasboard.LoadFromXml(RepData);

                DataSet datasourcelist = Genel.DsGetir(DashboardID, true);
                //dasboard.DataSources.Clear();
                foreach (DataTable item in datasourcelist.Tables)
                {
                    if (dasboard.DataSources.Where(z => z.Name == item.TableName).FirstOrDefault() == null)
                    {
                        dasboard.AddDataSource(item.TableName, item);
                    }
                }
                dasboard.DataLoading += dasboard_DataLoading;

                DashboardTasarim rep = new DashboardTasarim(dasboard);

                rep.ShowDialog();

                if (rep.SaveDashboard)
                {
                    MemoryStream stream = new MemoryStream();
                    rep.Dashboard.SaveToXml(stream);
                    stream.Position = 0;
                    byte[] RaporData = Genel.StreamToByteArray(stream);
                    data.IUD_Evraklar(4, DashboardID, RaporData, null, null, null, null, null, null, null, null, true, Genel.AktifKullaniciID);
                }
            }


            #endregion
        }