Esempio n. 1
0
        public void InitPages(int index)
        {
            FUpdatingTabs = true;

            // add tabs
            FTabs.Tabs.Clear();

            // code tab
            TabItem codeTab = new TabItem();

            codeTab.Text  = Res.Get("Designer,Workspace,Code");
            codeTab.Image = Res.GetImage(61);
            FTabs.Tabs.Add(codeTab);

            // page tabs
            foreach (PageBase page in FReport.Pages)
            {
                TabItem pageTab = new TabItem();
                pageTab.Tag  = page;
                pageTab.Text = page.PageName;
                ObjectInfo info = RegisteredObjects.FindObject(page);
                pageTab.Image = info.Image;
                FTabs.Tabs.Add(pageTab);
            }

            FUpdatingTabs   = false;
            ActivePageIndex = index;
            FTabs.Refresh();
        }
        private void PrepareReportEditor()
        {
            // Скрытие неподдерживаемых элементов

            var insertOperations = RegisteredObjects.FindObject(typeof(ReportPage));

            if (insertOperations != null)
            {
                foreach (var insertOperation in insertOperations.Items)
                {
                    if (insertOperation.Object == null || SupportedObjects.Contains(insertOperation.Object) == false)
                    {
                        insertOperation.Enabled = false;
                    }
                }
            }

            // Настройка элементов редактора

            PrepareControl(new Func <Control, bool>[]
            {
                DisableStandardToolBar,
                DisableStyleToolBar,
                EnableTextToolBar,
                EnableBorderToolBar,
                EnableLayoutToolBar,
                SetObjectsToolBar,
                FindDataWindow,
                FindPropertiesWindow,
                FindConfigBandsButton
            }, new List <Control>(), _reportEditor);
        }
Esempio n. 3
0
        private void EnumComponents(Base rootComponent, TreeNodeCollection rootNode)
        {
            string name = rootComponent is Report ?
                          "Report - " + Designer.ActiveReportTab.ReportName : rootComponent.Name;
            TreeNode node = rootNode.Add(name);

            node.Tag = rootComponent;

            FComponents.Add(rootComponent);
            FNodes.Add(node);

            ObjectInfo objItem = RegisteredObjects.FindObject(rootComponent);

            if (objItem != null)
            {
                int imageIndex = objItem.ImageIndex;
                node.ImageIndex         = imageIndex;
                node.SelectedImageIndex = imageIndex;
            }

            foreach (Base component in rootComponent.ChildObjects)
            {
                EnumComponents(component, node.Nodes);
            }
        }
Esempio n. 4
0
        public IActionResult ParameterBasedReport([FromForm] ParameterBasedReport parameterBasedReport)
        {
            string reportTitle = parameterBasedReport.ReportTitle;
            var    report      = _businessLayer.GetAllReportInfos().Where(x => x.ReportName == reportTitle).FirstOrDefault();

            string filepath = parameterBasedReport.ReportPath;
            string finId    = parameterBasedReport.ParameterValue;

            //string fromDate = parameterBasedReport.FromDate;
            RegisteredObjects.AddConnection(typeof(MsSqlDataConnection));
            WebReport webReport = new WebReport();

            webReport.Report.Load(filepath);

            /*TableDataSource ds = webReport.Report.GetDataSource("Settlement") as TableDataSource;
             * string command = ds.SelectCommand;*/
            ViewBag.WebReport   = webReport;
            ViewBag.banklist    = GetBankList();
            ViewBag.ReportName  = filepath;
            ViewBag.ReportTitle = reportTitle;
            if (finId != null)
            {
                var bank = _businessLayer.GetFinInstitutionInfoById(finId);
                webReport.Report.SetParameterValue("BankName", bank.InstitutionName);
                webReport.Report.SetParameterValue("FinancialInstitutionId", finId);
                ViewBag.FinancialId = finId;
            }
            TempData["ReportLoaded"] = "true";
            return(View(report));
        }
Esempio n. 5
0
        internal Type GetBindableControlType()
        {
            switch (BindableControl)
            {
            case ColumnBindableControl.Text:
                return(typeof(TextObject));

            case ColumnBindableControl.Picture:
                return(typeof(PictureObject));

            case ColumnBindableControl.CheckBox:
                return(typeof(CheckBoxObject));

            case ColumnBindableControl.RichText:
                return(typeof(RichObject));

            case ColumnBindableControl.Custom:
                Type controlType = RegisteredObjects.FindType(CustomBindableControl);
                if (controlType == null)
                {
                    return(typeof(TextObject));
                }
                return(controlType);
            }
            return(null);
        }
Esempio n. 6
0
        public WebReport GetReport(string OPID, string DDL_License_Name, string DDL_PlanID)
        {
            RegisteredObjects.AddConnection(typeof(MsSqlDataConnection));
            var webReport = new WebReport();

            var sqlConnection = new MsSqlDataConnection
            {
                ConnectionString = "Data Source=10.29.1.116;Initial Catalog=sptosystem;Persist Security Info=True;User ID=sa;Password=pwpolicy;Application Name=SPTO_SYSTEM"
            };

            //sqlConnection.ConnectionString = sqlConnection;
            sqlConnection.CreateAllTables();
            webReport.Report.Dictionary.Connections.Add(sqlConnection);
            webReport.Report.Load($@"Reports/Untitled.frx");
            //var string staffop = OPID ;
            //const string planid = "T2220-0001";
            //const string license = "CO1001";
            webReport.Report.SetParameterValue("PAM_OP", OPID);
            webReport.Report.SetParameterValue("PAM_PLANID", DDL_PlanID);
            webReport.Report.SetParameterValue("PAM_License", DDL_License_Name);

            ViewBag.WebReport = webReport;
            ViewBag.OPID      = OPID;
            return(webReport);
        }
Esempio n. 7
0
        public bool RegisterObject(SaveableObject obj)
        {
            if (obj.Id != 0)
            {
                return(false);
            }

            if (!Attribute.IsDefined(obj.GetType(), typeof(SerializableAttribute)))
            {
                return(false);
            }

            obj.Id = m_currentId++;
            RegisteredObjects.Add(m_currentId, obj);

            if (RegisteredTypes.TryGetValue(obj.ClassId, out Type val))
            {
                if (val != obj.GetType())
                {
                    throw new ArgumentException();
                }
            }
            else
            {
                RegisteredTypes.Add(obj.ClassId, obj.GetType());
            }

            return(true);
        }
Esempio n. 8
0
 private TreeNodeCollection AddBand(BandBase band, TreeNodeCollection nodes)
 {
     if (band != null)
     {
         ObjectInfo info     = RegisteredObjects.FindObject(band);
         string     infoText = Res.Get(info.Text);
         infoText += ": " + band.Name;
         if (band is DataBand || band is GroupHeaderBand)
         {
             if (!String.IsNullOrEmpty(band.GetInfoText()))
             {
                 infoText += " (" + band.GetInfoText() + ")";
             }
         }
         TreeNode node       = nodes.Add(infoText);
         int      imageIndex = info.ImageIndex;
         node.ImageIndex         = imageIndex;
         node.SelectedImageIndex = imageIndex;
         node.Tag = band;
         if (band == FLastSelectedBand)
         {
             tvBands.SelectedNode = node;
         }
         AddBand(band.Child, node.Nodes);
         return(node.Nodes);
     }
     return(null);
 }
Esempio n. 9
0
 public App()
 {
     RegisteredObjects.AddConnection(typeof(SqlCeDataConnection));
     AppDomain.CurrentDomain.AssemblyLoad += CurrentDomain_AssemblyLoad;
     EventManager.RegisterClassHandler(typeof(TextBox), UIElement.KeyDownEvent, new KeyEventHandler(KeyDown));
     EventManager.RegisterClassHandler(typeof(ComboBox), UIElement.KeyDownEvent, new KeyEventHandler(KeyDown));
 }
Esempio n. 10
0
 public static void Main()
 {
     // AppDomain.CurrentDomain.AssemblyResolve +=OnResolveAssembly;
     RegisteredObjects.AddConnection(typeof(SQLiteDataConnection));
     // Debug.WriteLine("dbthread init now....");
     App.Main();
 }
Esempio n. 11
0
        /// <inheritdoc/>
        public override void Draw(FRPaintEventArgs e)
        {
            Graphics g = e.Graphics;

            UpdateWidth();
            if (IsDesigning)
            {
                RectangleF bounds = Bounds;
                bounds.X      *= e.ScaleX;
                bounds.Y      *= e.ScaleY;
                bounds.Width   = DesignWidth * e.ScaleX;
                bounds.Height *= e.ScaleY;

                if (ReportWorkspace.ClassicView && Width != 0)
                {
                    RectangleF fillRect = new RectangleF(bounds.Left, bounds.Top - (HeaderSize - 1) * e.ScaleY,
                                                         bounds.Width, (HeaderSize - 1) * e.ScaleY);
                    if (Bounds.Top == HeaderSize)
                    {
                        fillRect.Y       = 0;
                        fillRect.Height += e.ScaleY;
                    }
                    DrawBandHeader(g, fillRect, true);

                    ObjectInfo info = RegisteredObjects.FindObject(this);
                    string     text = Res.Get(info.Text);
                    if (GetInfoText() != "")
                    {
                        text += ": " + GetInfoText();
                    }
                    fillRect.X += 4;
                    TextRenderer.DrawText(g, text, DrawUtils.Default96Font,
                                          new Rectangle((int)fillRect.Left, (int)fillRect.Top, (int)fillRect.Width, (int)fillRect.Height),
                                          SystemColors.WindowText, TextFormatFlags.VerticalCenter);
                }

                g.FillRectangle(SystemBrushes.Window, bounds.Left, (int)Math.Round(bounds.Top),
                                bounds.Width, bounds.Height + (ReportWorkspace.ClassicView ? 1 : 4));
                DrawBackground(e);
                if (ReportWorkspace.ShowGrid)
                {
                    ReportWorkspace.Grid.Draw(g, bounds, e.ScaleX);
                }

                if (!ReportWorkspace.ClassicView)
                {
                    Pen pen = e.Cache.GetPen(Color.Silver, 1, DashStyle.Dot);
                    g.DrawLine(pen, bounds.Left, bounds.Bottom + 1, bounds.Right + 1, bounds.Bottom + 1);
                    g.DrawLine(pen, bounds.Left + 1, bounds.Bottom + 2, bounds.Right + 1, bounds.Bottom + 2);
                    g.DrawLine(pen, bounds.Left, bounds.Bottom + 3, bounds.Right + 1, bounds.Bottom + 3);
                }
            }
            else
            {
                DrawBackground(e);
                Border.Draw(e, new RectangleF(AbsLeft, AbsTop, Width, Height));
            }
        }
Esempio n. 12
0
        GenericRegisterObject
            (Camera objectToRegister,
            bool objectIsAPrefab,
            InitialisationDelegate initialisationCallback,
            int Index)
        {
            Camera Instance;

            if (objectIsAPrefab)
            {
                GameObject Prefab = objectToRegister.gameObject;
                GameObject Obj    = GameObject.Instantiate(Prefab);
                Instance = Obj.GetComponent <Camera>();
                MyContract.RequireArgumentNotNull(Instance, "Camera Component");
            }
            else
            {
                Instance = objectToRegister;
                Debug.Assert(Instance != null, "Provided object was null");
            }

            if (initialisationCallback != null)
            {
                initialisationCallback(Instance, Index);
            }

            IGameObjectRegistryKeyComponent KeyComponent
                = Instance.GetComponent <IGameObjectRegistryKeyComponent>();
            int element = KeyComponent.Key;

            //Debug.Log("Adding element " + element.ToString() + " to the dictionary.");
            if (RegisteredObjects.ContainsKey(element) &&
                RetrieveObject(element) != null)
            {
                throw new InvalidOperationException(
                          "Trying to register a second GameObject "
                          + " with element identifier "
                          + PrintKey(element)
                          );
            }
            else if (RegisteredObjects.ContainsKey(element) &&
                     RetrieveObject(element) == null)
            {
                // assume a deliberate replace intent
                RegisteredObjects[element] = Instance;
            }
            else
            {
                RegisteredObjects.Add(element, Instance);
            }

            if (PersistThroughScenes)
            {
                GameObject.DontDestroyOnLoad(Instance);
                GameObject.DontDestroyOnLoad(Instance.gameObject);
            }
        }
        /// <summary>
        /// Indicates that series is using an axis.
        /// </summary>
        /// <param name="value">The series using the axis.</param>
        internal void Register(object value)
        {
            Debug.Assert(value != null, "object cannot be null.");
            Debug.Assert(!RegisteredObjects.Contains(value), "object has already been registered with the axis.");

            RegisteredObjects.Add(value);
            IsUsed = true;

            OnObjectRegistered(value);
        }
Esempio n. 14
0
        //public static string EncryptedVeritabanıadresi;
        /// <summary>
        /// Initializes a new instance of the <see cref="App"/> class.
        /// </summary>
        public App()
        {
            //string Encrypted = System.Configuration.ConfigurationManager.ConnectionStrings["SqlceConnection"].ConnectionString;
            //byte[] data = Convert.FromBase64String(Encrypted);
            //EncryptedVeritabanıadresi = Encoding.UTF8.GetString(data);

            RegisteredObjects.AddConnection(typeof(SqlCeDataConnection));
            AppDomain.CurrentDomain.AssemblyLoad += CurrentDomain_AssemblyLoad;
            EventManager.RegisterClassHandler(typeof(TextBox), UIElement.KeyDownEvent, new KeyEventHandler(KeyDown));
            EventManager.RegisterClassHandler(typeof(ComboBox), UIElement.KeyDownEvent, new KeyEventHandler(KeyDown));
        }
Esempio n. 15
0
 private void CreateInsertMenu()
 {
     if (Designer.ActiveReportTab != null && Designer.ActiveReportTab.ActivePage != null)
     {
         ObjectInfo pageItem = RegisteredObjects.FindObject(Designer.ActiveReportTab.ActivePage);
         if (pageItem != null)
         {
             InsertMenuCreateMenus(pageItem, miInsert.SubItems);
         }
     }
 }
Esempio n. 16
0
 public override void Deserialize(FRReader reader)
 {
     FPageType = RegisteredObjects.FindType(reader.ReadStr("PageType"));
     while (reader.NextItem())
     {
         Base c = reader.Read() as Base;
         if (c != null)
         {
             FObjects.Add(c);
         }
     }
 }
Esempio n. 17
0
 private void button1_Click(object sender, EventArgs e)
 {
     RegisteredObjects.AddConnection(typeof(GoogleBigQueryDataConnection));
     using (Report report = new Report())
     {
         string reportFileName = "report.frx";
         if (File.Exists(reportFileName))
         {
             report.Load(reportFileName);
         }
         report.Design();
     }
 }
        /// <summary>
        /// Indicates that a series is no longer using an axis.
        /// </summary>
        /// <param name="value">The series no longer using the axis.</param>
        internal void Unregister(object value)
        {
            Debug.Assert(value != null, "object cannot be null.");
            Debug.Assert(RegisteredObjects.Contains(value), "object is not registered with the axis.");

            RegisteredObjects.Remove(value);
            if (RegisteredObjects.Count == 0)
            {
                IsUsed = false;
            }

            OnObjectUnregistered(value);
        }
Esempio n. 19
0
 private static void AddCustomMethods()
 {
     //RegisteredObjects.AddCategory("Variables,CustomData", FastReport.Utils.Res.GetImage(66), "CustomData");
     RegisteredObjects.AddFunction(typeof(ReportMethod).GetMethod("Contains"), "Text");
     RegisteredObjects.AddFunction(typeof(ReportMethod).GetMethod("ToFloat"), "Conversion");
     RegisteredObjects.AddFunction(typeof(ReportMethod).GetMethod("ToDateTimeEx"), "Conversion");
     RegisteredObjects.AddFunction(typeof(ReportMethod).GetMethod("ToChineseUpper"), "Text");
     RegisteredObjects.AddFunction(typeof(ReportMethod).GetMethod("GetDisplayOrder"), "Conversion");
     RegisteredObjects.AddFunction(typeof(ReportMethod).GetMethod("SwapPageOrder"), "Conversion");
     RegisteredObjects.AddFunction(typeof(ReportMethod).GetMethod("GetDataByIndex"), "Conversion");
     //RegisteredObjects.AddFunctionCategory("CustomMethod", "CustomMethod");
     //RegisteredObjects.AddFunction(typeof(CommonExpand).GetMethod("GetBrithDateByCardId"), "CustomMethod");
 }
Esempio n. 20
0
        public void PurgeContainer()
        {
            foreach (var registeredObject in RegisteredObjects.ToList())
            {
                RegisteredObjects.Remove(registeredObject);
                registeredObject.Dispose();
            }

            foreach (var registeredObject in GlobalRegisteredObjects.ToList())
            {
                GlobalRegisteredObjects.Remove(registeredObject);
                registeredObject.Dispose();
            }
        }
Esempio n. 21
0
        protected override void OnDrawItem(DrawItemEventArgs e)
        {
            e.DrawBackground();

            Base  c   = Items[e.Index] as Base;
            Image img = c == null?Res.GetImage(76) : RegisteredObjects.FindObject(c).Image;

            e.Graphics.DrawImage(img, e.Bounds.X + 2, e.Bounds.Y + 1);
            using (Brush b = new SolidBrush(e.ForeColor))
            {
                e.Graphics.DrawString(c == null ? Res.Get("Misc,None") : c.Name, e.Font, b,
                                      e.Bounds.X + 24, e.Bounds.Y + (e.Bounds.Height - DrawUtils.DefaultItemHeight) / 2);
            }
        }
Esempio n. 22
0
        public IActionResult Index()
        {
            string filepath = TempData["FilePath"] as string;

            currentReportPath = filepath;
            RegisteredObjects.AddConnection(typeof(MsSqlDataConnection));
            WebReport webReport = new WebReport();

            webReport.Report.Load(filepath);
            ViewBag.WebReport  = webReport;
            ViewBag.ReportName = currentReportPath;

            return(View());
        }
Esempio n. 23
0
        GenericRegisterObject
            (GameObject originalObject,
            bool objectIsAPrefab,
            InitialisationDelegate initialisationCallback,
            int Index)
        {
            GameObject Instance;

            if (objectIsAPrefab)
            {
                GameObject Prefab = originalObject;
                Instance = GameObject.Instantiate(Prefab);
                Debug.Assert(Instance != null, "Instantiate returned null");
            }
            else
            {
                Instance = originalObject;
                Debug.Assert(Instance != null, "Provided object was null");
            }

            if (initialisationCallback != null)
            {
                initialisationCallback(Instance, Index);
            }

            IGameObjectRegistryKeyComponent KeyComponent
                = Instance.GetComponent <IGameObjectRegistryKeyComponent>();
            int element = KeyComponent.Key;

            //Debug.Log("Adding element " + element.ToString() + " to the dictionary.");
            if (RegisteredObjects.ContainsKey(element) &&
                RetrieveObject(element) != null)
            {
                throw new InvalidOperationException(
                          "Trying to register a second GameObject "
                          + " with element identifier "
                          + PrintKey(element)
                          );
            }
            else
            {
                RegisteredObjects.Add(element, Instance);
            }

            if (PersistThroughScenes)
            {
                GameObject.DontDestroyOnLoad(Instance);
            }
        }
Esempio n. 24
0
        private void CreateButtons()
        {
            if (Designer.ActiveReport != null && Designer.ActiveReport == FCurrentReport &&
                Designer.ActiveReportTab.ActivePage == FCurrentPage)
            {
                return;
            }
            FCurrentReport = Designer.ActiveReport;
            if (Designer.ActiveReportTab != null)
            {
                FCurrentPage = Designer.ActiveReportTab.ActivePage;
            }
            else
            {
                FCurrentPage = null;
            }

            // delete all buttons except pointer
            int i = 0;

            while (i < Items.Count)
            {
                if (Items[i] == btnSelect)
                {
                    i++;
                }
                else
                {
                    Items[i].Dispose();
                    Items.RemoveAt(i);
                }
            }

            if (FCurrentPage == null)
            {
                RecalcLayout();
                return;
            }

            // create object buttons
            ObjectInfo pageItem = RegisteredObjects.FindObject(FCurrentPage);

            if (pageItem != null)
            {
                DoCreateButtons(pageItem, Items);
            }

            RecalcLayout();
        }
Esempio n. 25
0
        private static void Configure(IUnityContainer container)
        {
            // инициализируем Environment
            container.RegisterType <IWmsEnvironmentInfoProvider, WebWmsEnvironmentInfoProvider>(
                new ContainerControlledLifetimeManager());
            container.RegisterType <ILocalData, WebLocalData>(new ContainerControlledLifetimeManager());
            WmsEnvironment.Init(container.Resolve <IWmsEnvironmentInfoProvider>(), container.Resolve <ILocalData>());

            // запускаем wf
            WorkflowServicesUnityConfigurator.Configure(container, true);

            // настраиваем fr
            FastReport.Utils.Config.WebMode = true;
            RegisteredObjects.AddConnection(typeof(OracleDataConnection));
        }
Esempio n. 26
0
        public MeGonnaBeRandomAssemblyInitializer()
        {
            if (!isInitied)
            {
                isInitied = true;
                RegisteredObjects.AddConnection(typeof(MeGonnaBeRandom), "Генератор случайных величин");

                Utils.Register(new DateGenerator());
                Utils.Register(new FirstNameGenerator());
                Utils.Register(new FullNameGenerator());
                Utils.Register(new LastNameGenerator());
                Utils.Register(new IntGenerator());
                Utils.Register(new MixedGenerator());
            }
        }
Esempio n. 27
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Config.DesignerSettings.ShowInTaskbar = true;
            Config.SplashScreenEnabled            = true;


            using (Report report = new Report())
            {
                RegisteredObjects.Add(typeof(HtmlObject), "ReportPage", 246, 18);
                report.Design();
            }
        }
Esempio n. 28
0
        public IActionResult BasicReport(string ReportName)
        {
            var report = _businessLayer.GetAllReportInfos().Where(x => x.ReportName == ReportName).FirstOrDefault();

            string filepath = @"Reports\" + report.ReportPath;

            RegisteredObjects.AddConnection(typeof(MsSqlDataConnection));
            WebReport webReport = new WebReport();

            webReport.Report.Load(filepath);
            ViewBag.ReportTitle = report.ReportName;
            ViewBag.WebReport   = webReport;
            ViewBag.ReportName  = filepath;
            return(View(report));
        }
Esempio n. 29
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            RegisteredObjects.Add(typeof(ParticleSystem), "ReportPage", ParticleSystemFRNet.Properties.Resources.ParticleSystemIcon, "Particle System");

            Config.DesignerSettings.ShowInTaskbar = true;
            Config.SplashScreenEnabled            = true;

            using (Report report = new Report())
            {
                report.Design();
            }
        }
Esempio n. 30
0
        public static Reports GetReportRaznaryadka(string dt, string reportName, string Raion, string Oblast)
        {
            RegisteredObjects.AddConnection(typeof(MsSqlDataConnection));
            Reports webR = new Reports();

            webR.report = new WebReport();

            /*
             * MsSqlDataConnection _con = new MsSqlDataConnection();
             * _con.ConnectionString = spDAL.connStr;
             * _con.CreateAllTables();
             * webR.report.Report.Dictionary.Connections.Add(_con);
             */
            string _path = System.IO.Directory.GetCurrentDirectory();

            _path = _path
                    + System.IO.Path.DirectorySeparatorChar
                    + "FastReports"
                    + System.IO.Path.DirectorySeparatorChar
                    + "CA"
                    + System.IO.Path.DirectorySeparatorChar
                    + reportName
                    + ".frx";

            int m = Int32.Parse(dt.Substring(0, 2));
            int y = Int32.Parse(dt.Substring(3, 4));

            webR.report.Report.Load(_path);
            webR.report.Report.Dictionary.Connections[0].ConnectionString = spDAL.connStr;
            webR.report.Report.SetParameterValue("yyyy", y);
            webR.report.Report.SetParameterValue("mm", m);
            if (Raion is null)
            {
                Raion = "";
            }
            if (Oblast is null)
            {
                Oblast = "";
            }
            webR.report.Report.SetParameterValue("raion", Raion);
            webR.report.Report.SetParameterValue("Oblast", Oblast);
            //webR.report.Report.Prepare();
            webR.dt         = dt;
            webR.ReportName = reportName;
            //TableDataSource table = webR.report.Report.GetDataSource("v1") as TableDataSource;
            //table.SelectCommand = "";
            return(webR);
        }