Exemple #1
0
        private void ReadLineObject(XmlNode node, StiBand band)
        {
            StiHorizontalLinePrimitive line = new StiHorizontalLinePrimitive();

            band.Components.Add(line);

            ReadComp(node, line);
        }
Exemple #2
0
        private void ReadBand(XmlNode node, StiBand band)
        {
            ReadComp(node, band);

            band.CanBreak = ReadBool(node, "CanBreak", band, true);

            foreach (XmlNode elementNode in node.ChildNodes)
            {
                switch (elementNode.Name)
                {
                case "TextObject":
                    ReadTextObject(elementNode, band);
                    break;

                case "PictureObject":
                    ReadPictureObject(elementNode, band);
                    break;

                case "CheckBoxObject":
                    ReadCheckBoxObject(elementNode, band);
                    break;

                case "LineObject":
                    ReadLineObject(elementNode, band);
                    break;

                case "ChildBand":
                    ReadChildBand(elementNode, band.Page);
                    break;

                case "DataHeaderBand":
                    ReadDataHeaderBand(elementNode, band.Page, band);
                    break;

                case "DataBand":
                    ReadDataBand(elementNode, band.Page, band);
                    break;

                case "DataFooterBand":
                    ReadDataFooterBand(elementNode, band.Page, band);
                    break;

                case "GroupHeaderBand":
                    ReadGroupHeaderBand(elementNode, band.Page);
                    break;

                case "GroupFooterBand":
                    ReadGroupFooterBand(elementNode, band.Page);
                    break;

                case "SubreportObject":
                    ReadSubreportObject(elementNode, band);
                    break;
                }
            }
        }
Exemple #3
0
        private void ReadDataFooterBand(XmlNode node, StiPage page, StiBand masterBand)
        {
            StiFooterBand band = new StiFooterBand();

            page.Components.Add(band);

            ReadBand(node, band);

            band.KeepFooterTogether = ReadBool(node, "KeepWithData", band, false);
        }
Exemple #4
0
        private void ReadCheckBoxObject(XmlNode node, StiBand band)
        {
            StiCheckBox checkBox = new StiCheckBox();

            band.Components.Add(checkBox);

            ReadComp(node, checkBox);

            checkBox.Checked.Value = "{" + ReadString(node, "DataColumn", "") + "}";
        }
Exemple #5
0
        private void ReadPictureObject(XmlNode node, StiBand band)
        {
            StiImage image = new StiImage();

            band.Components.Add(image);

            ReadComp(node, image);

            image.DataColumn = ReadString(node, "DataColumn", "");
        }
Exemple #6
0
        private void ReadDataBand(XmlNode node, StiPage page, StiBand masterBand)
        {
            StiDataBand band = new StiDataBand();

            page.Components.Add(band);

            ReadBand(node, band);

            band.MasterComponent = masterBand;

            string dataSource = ReadString(node, "DataSource", band.Name);

            band.DataSourceName = dataSource;
        }
Exemple #7
0
        private void ReadDataHeaderBand(XmlNode node, StiPage page, StiBand masterBand)
        {
            StiHeaderBand band = new StiHeaderBand();

            if (masterBand != null)
            {
                page.Components.Insert(page.Components.IndexOf(masterBand), band);
            }
            else
            {
                page.Components.Add(band);
            }

            ReadBand(node, band);

            band.KeepHeaderTogether = ReadBool(node, "KeepWithData", band, false);
        }
Exemple #8
0
        private void ReadReportFooterBand(XtraReportBase xtraReport, ReportFooterBand xtraBand, StiPage page)
        {
            StiBand band = null;

            if (detailLevel == 0)
            {
                band = new StiReportSummaryBand();
            }
            else
            {
                band = new StiFooterBand();
                (band as StiFooterBand).PrintOnAllPages = false;
            }
            page.Components.Add(band);

            ReadBand(xtraBand, band);
        }
Exemple #9
0
        private void ReadBand(Band xtraBand, StiBand band)
        {
            ReadComp(xtraBand, band);

            #region IStiPageBreak
            IStiPageBreak pageBreak = band as IStiPageBreak;
            if (pageBreak != null)
            {
                pageBreak.NewPageBefore = xtraBand.PageBreak == PageBreak.BeforeBand;
                pageBreak.NewPageAfter  = xtraBand.PageBreak == PageBreak.AfterBand;
            }
            #endregion

            ProcessControls(xtraBand.Controls, band);

            totalHeight += band.Height;
        }
Exemple #10
0
        private void ReadTextObject(XmlNode node, StiBand band)
        {
            StiText text = new StiText();

            band.Components.Add(text);

            ReadComp(node, text);

            text.Text.Value = ReadString(node, "Text", "");

            /*if (text.Text.Value.StartsWith("[") && text.Text.Value.EndsWith("]"))
             * {
             *  text.Text.Value = "{" + text.Text.Value.Substring(1, text.Text.Value.Length - 2) + "}";
             * }*/

            text.Angle = -(float)ReadDouble(node, "Angle", text, 0d);

            text.LinesOfUnderline        = ReadBool(node, "Underlines", text, false) ? StiPenStyle.Solid : StiPenStyle.None;
            text.AutoWidth               = ReadBool(node, "AutoWidth", text, false);
            text.RenderTo                = ReadString(node, "BreakTo", "");
            text.HideZeros               = ReadBool(node, "HideZeros", text, false);
            text.AllowHtmlTags           = ReadBool(node, "HtmlTags", text, false);
            text.TextOptions.RightToLeft = ReadBool(node, "RightToLeft", text, false);
            text.WordWrap                = ReadBool(node, "WordWrap", text, true);
            text.TextQuality             = ReadBool(node, "Wysiwyg", text, false) ? StiTextQuality.Wysiwyg : StiTextQuality.Standard;
            text.OnlyText                = ReadBool(node, "AllowExpressions", text, true) ? false : true;

            #region Trimming
            switch (ReadString(node, "Trimming", "None"))
            {
            case "None":
                text.TextOptions.Trimming = StringTrimming.None;
                break;

            case "Character":
                text.TextOptions.Trimming = StringTrimming.Character;
                break;

            case "EllipsisCharacter":
                text.TextOptions.Trimming = StringTrimming.EllipsisCharacter;
                break;

            case "EllipsisPath":
                text.TextOptions.Trimming = StringTrimming.EllipsisPath;
                break;

            case "EllipsisWord":
                text.TextOptions.Trimming = StringTrimming.EllipsisWord;
                break;

            case "Word":
                text.TextOptions.Trimming = StringTrimming.Word;
                break;
            }
            #endregion

            #region Duplicates
            switch (ReadString(node, "Duplicates", "Show"))
            {
            case "Show":
                text.ProcessingDuplicates = StiProcessingDuplicatesType.None;
                break;

            case "Hide":
                text.ProcessingDuplicates = StiProcessingDuplicatesType.Hide;
                break;

            case "Clear":
                text.ProcessingDuplicates = StiProcessingDuplicatesType.RemoveText;
                break;

            case "Merge":
                text.ProcessingDuplicates = StiProcessingDuplicatesType.Merge;
                break;
            }
            #endregion

            #region HorzAlign
            switch (ReadString(node, "HorzAlign", ""))
            {
            case "Center":
                text.HorAlignment = StiTextHorAlignment.Center;
                break;

            case "Right":
                text.HorAlignment = StiTextHorAlignment.Right;
                break;

            case "Justify":
                text.HorAlignment = StiTextHorAlignment.Width;
                break;

            default:
                text.HorAlignment = StiTextHorAlignment.Left;
                break;
            }
            #endregion

            #region VertAlign
            switch (ReadString(node, "VertAlign", ""))
            {
            case "Center":
                text.VertAlignment = StiVertAlignment.Center;
                break;

            case "Bottom":
                text.VertAlignment = StiVertAlignment.Bottom;
                break;

            default:
                text.VertAlignment = StiVertAlignment.Top;
                break;
            }
            #endregion

            #region Font
            try
            {
                XmlAttribute attrName = node.Attributes["Font"];
                if (attrName != null)
                {
                    FontConverter fontConverter = new FontConverter();
                    text.Font = fontConverter.ConvertFromString(attrName.Value) as Font;
                }
            }
            catch
            {
            }
            #endregion
        }