Beispiel #1
0
        private void LoadLabel(XmlNode node, Base parent)
        {
            TextObject text = ComponentsFactory.CreateTextObject(node.Name, parent);

            AddLocalizationItemsAttributes(node);
            LoadComponent(node, text);
            LoadSize(node, text);
            LoadBorder(node, text.Border);
            text.Font      = LoadFontXml(GetAttribute(node, "Font"));
            text.Text      = GetAttribute(node, "Text");
            text.FillColor = UnitsConverter.ConvertBackColor(GetAttribute(node, "BackColor"));
            text.TextColor = UnitsConverter.ConvertColor(GetAttribute(node, "ForeColor"));
            text.HorzAlign = UnitsConverter.ConvertTextAlignmentToHorzAlign(GetAttribute(node, "TextAlignment"));
            text.VertAlign = UnitsConverter.ConvertTextAlignmentToVertAlign(GetAttribute(node, "TextAlignment"));
            ApplyStyle(node, text);
        }
        private void LoadLabel(string name, Base parent)
        {
            string     description = GetObjectDescription(name);
            TextObject text        = ComponentsFactory.CreateTextObject(name, parent);

            LoadComponent(description, text);
            LoadSize(description, text);
            LoadBorder(description, text.Border);
            text.Name      = name;
            text.FillColor = UnitsConverter.ConvertBackColor(GetPropertyValue("BackColor", description));
            text.TextColor = UnitsConverter.ConvertColor(GetPropertyValue("ForeColor", description));
            text.Text      = GetPropertyValue("Text", description).Replace("\"", "");
            text.HorzAlign = UnitsConverter.ConvertTextAlignmentToHorzAlign(GetPropertyValue("TextAlignment", description));
            text.VertAlign = UnitsConverter.ConvertTextAlignmentToVertAlign(GetPropertyValue("TextAlignment", description));
            text.Font      = LoadFont(description);
            ApplyStyleByName(text, GetPropertyValue("StyleName", description).Replace("\"", ""));
        }
Beispiel #3
0
        private void LoadObjects()
        {
            DataBand band = ComponentsFactory.CreateDataBand(page);

            band.Height = page.PaperHeight * Units.Millimeters;
            List <int> objects = GetAllObjectsLL();

            foreach (int index in objects)
            {
                string objectName = GetValueLL("ObjectName", index);
                switch (objectName)
                {
                case "Text":
                    TextObject textObj = ComponentsFactory.CreateTextObject("", band);
                    LoadTextObject(index, textObj);
                    break;

                case "Line":
                    LineObject lineObj = ComponentsFactory.CreateLineObject("", band);
                    LoadLineObject(index, lineObj);
                    break;

                case "Rectangle":
                    ShapeObject rectangle = ComponentsFactory.CreateShapeObject("", band);
                    LoadRectangle(index, rectangle);
                    break;

                case "Ellipse":
                    ShapeObject ellipse = ComponentsFactory.CreateShapeObject("", band);
                    LoadEllipse(index, ellipse);
                    break;

                case "Picture":
                    PictureObject pictureObj = ComponentsFactory.CreatePictureObject("", band);
                    LoadPictureObject(index, pictureObj);
                    break;
                }
            }
        }
        private void LoadTextbox(XmlNode textboxNode)
        {
            if (parent is TableCell)
            {
                component = (TableCell)parent;
            }
            else
            {
                component = ComponentsFactory.CreateTextObject(textboxNode.Attributes["Name"].Value, parent);
            }
            XmlNodeList nodeList = textboxNode.ChildNodes;

            LoadReportItem(nodeList);
            foreach (XmlNode node in nodeList)
            {
                if (node.Name == "CanGrow")
                {
                    (component as TextObject).CanGrow = UnitsConverter.BooleanToBool(node.InnerText);
                }
                else if (node.Name == "CanShrink")
                {
                    (component as TextObject).CanShrink = UnitsConverter.BooleanToBool(node.InnerText);
                }
                else if (node.Name == "HideDuplicates")
                {
                    (component as TextObject).Duplicates = Duplicates.Hide;
                }
                else if (node.Name == "Value")
                {
                    (component as TextObject).Text = node.InnerText;
                }
                else if (node.Name == "Paragraphs")
                {
                    LoadParagraphs(node);
                }
            }
        }