コード例 #1
0
        void dasboard_DataLoading(object sender, DashboardDataLoadingEventArgs e)
        {
            if (datasourcedisardan != null)
            {
                foreach (DataTable item in datasourcedisardan.Tables)
                {
                    if (e.DataSource.Name == item.TableName)
                    {
                        e.Data = item;
                    }
                }
            }
            else
            {
                DataSet datasourcelist = Genel.DsGetir(DashboardID, true);

                foreach (DataTable item in datasourcelist.Tables)
                {
                    if (e.DataSource.Name == item.TableName)
                    {
                        e.Data = item;
                    }
                }
            }
            //        var list = Application.OpenForms;

            //            list[1].BeginInvoke(new Action(() => list[1].Hide()));

            //          var asdf = "";
        }
コード例 #2
0
        private void dasboard_DataLoading(object sender, DashboardDataLoadingEventArgs e)
        {
            DataSet datasourcelist = Genel.DsGetir(DashboardID, true);

            foreach (DataTable item in datasourcelist.Tables)
            {
                if (e.DataSource.Name == item.TableName)
                {
                    e.Data = item;
                }
            }
        }
コード例 #3
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
        }