コード例 #1
0
 private void LoadReportItem(XmlNodeList nodeList)
 {
     foreach (XmlNode node in nodeList)
     {
         if (node.Name == "Top")
         {
             component.Top = UnitsConverter.SizeToPixels(node.InnerText);
         }
         else if (node.Name == "Left")
         {
             component.Left = UnitsConverter.SizeToPixels(node.InnerText);
         }
         else if (node.Name == "Height")
         {
             component.Height = UnitsConverter.SizeToPixels(node.InnerText);
         }
         else if (node.Name == "Width")
         {
             component.Width = UnitsConverter.SizeToPixels(node.InnerText);
         }
         else if (node.Name == "Visibility")
         {
             LoadVisibility(node);
         }
         else if (node.Name == "Style")
         {
             LoadStyle(node);
         }
     }
     if (parent is TableCell)
     {
         component.Width  = (parent as TableCell).Width;
         component.Height = (parent as TableCell).Height;
     }
 }
コード例 #2
0
        private float LoadMatrixColumn(XmlNode matrixColumnNode, MatrixHeaderDescriptor column)
        {
            float       columnWidth = 2.5f * Utils.Units.Centimeters;
            XmlNodeList nodeList    = matrixColumnNode.ChildNodes;

            foreach (XmlNode node in nodeList)
            {
                if (node.Name == "Width")
                {
                    columnWidth = UnitsConverter.SizeToPixels(node.InnerText);
                }
            }
            return(columnWidth);
        }
コード例 #3
0
        private void LoadTableColumn(XmlNode tableColumnNode, TableColumn column)
        {
            XmlNodeList nodeList = tableColumnNode.ChildNodes;

            foreach (XmlNode node in nodeList)
            {
                if (node.Name == "Width")
                {
                    column.Width = UnitsConverter.SizeToPixels(node.InnerText);
                }
                else if (node.Name == "Visibility")
                {
                    LoadVisibility(node);
                }
            }
        }
コード例 #4
0
        private float LoadMatrixRow(XmlNode matrixRowNode, MatrixHeaderDescriptor row)
        {
            float       rowHeight = 0.8f * Utils.Units.Centimeters;
            XmlNodeList nodeList  = matrixRowNode.ChildNodes;

            foreach (XmlNode node in nodeList)
            {
                if (node.Name == "Height")
                {
                    rowHeight = UnitsConverter.SizeToPixels(node.InnerText);
                }
                else if (node.Name == "MatrixCells")
                {
                    LoadMatrixCells(node);
                }
            }
            return(rowHeight);
        }
コード例 #5
0
        private void LoadBody(XmlNode bodyNode)
        {
            parent  = ComponentsFactory.CreateDataBand(page);
            curBand = (BandBase)parent;
            XmlNodeList nodeList = bodyNode.ChildNodes;

            foreach (XmlNode node in nodeList)
            {
                if (node.Name == "ReportItems")
                {
                    LoadReportItems(node);
                }
                else if (node.Name == "Height")
                {
                    (parent as DataBand).Height = UnitsConverter.SizeToPixels(node.InnerText);
                }
            }
        }
コード例 #6
0
        private void LoadBorderWidth(XmlNode borderWidthNode)
        {
            XmlNodeList nodeList = borderWidthNode.ChildNodes;

            foreach (XmlNode node in nodeList)
            {
                if (node.Name == "Default")
                {
                    if (component is ReportComponentBase)
                    {
                        (component as ReportComponentBase).Border.Width = UnitsConverter.SizeToPixels(node.InnerText);
                    }
                }
                else if (node.Name == "Top")
                {
                    if (component is ReportComponentBase)
                    {
                        (component as ReportComponentBase).Border.TopLine.Width = UnitsConverter.SizeToPixels(node.InnerText);
                    }
                }
                else if (node.Name == "Left")
                {
                    if (component is ReportComponentBase)
                    {
                        (component as ReportComponentBase).Border.LeftLine.Width = UnitsConverter.SizeToPixels(node.InnerText);
                    }
                }
                else if (node.Name == "Right")
                {
                    if (component is ReportComponentBase)
                    {
                        (component as ReportComponentBase).Border.RightLine.Width = UnitsConverter.SizeToPixels(node.InnerText);
                    }
                }
                else if (node.Name == "Bottom")
                {
                    if (component is ReportComponentBase)
                    {
                        (component as ReportComponentBase).Border.BottomLine.Width = UnitsConverter.SizeToPixels(node.InnerText);
                    }
                }
            }
        }
コード例 #7
0
        private void LoadTableRow(XmlNode tableRowNode, TableRow row)
        {
            XmlNodeList nodeList = tableRowNode.ChildNodes;

            foreach (XmlNode node in nodeList)
            {
                if (node.Name == "TableCells" || node.Name == "TablixCells")
                {
                    LoadTableCells(node);
                }
                else if (node.Name == "Height")
                {
                    row.Height = UnitsConverter.SizeToPixels(node.InnerText);
                }
                else if (node.Name == "Visibility")
                {
                    LoadVisibility(node);
                }
            }
        }
コード例 #8
0
        private float LoadRowGrouping(XmlNode rowGroupingNode, List <XmlNode> dynamicRows, List <XmlNode> staticRows)
        {
            float       cornerWidth = 2.5f * Utils.Units.Centimeters;
            XmlNodeList nodeList    = rowGroupingNode.ChildNodes;

            foreach (XmlNode node in nodeList)
            {
                if (node.Name == "Width")
                {
                    cornerWidth = UnitsConverter.SizeToPixels(node.InnerText);
                }
                else if (node.Name == "DynamicRows")
                {
                    LoadDynamicRows(node, dynamicRows);
                }
                else if (node.Name == "StaticRows")
                {
                    LoadStaticRows(node, staticRows);
                }
            }
            return(cornerWidth);
        }
コード例 #9
0
        private float LoadColumnGrouping(XmlNode columnGroupingNode, List <XmlNode> dynamicColumns, List <XmlNode> staticColumns)
        {
            float       cornerHeight = 0.8f * Utils.Units.Centimeters;
            XmlNodeList nodeList     = columnGroupingNode.ChildNodes;

            foreach (XmlNode node in nodeList)
            {
                if (node.Name == "Height")
                {
                    cornerHeight = UnitsConverter.SizeToPixels(node.InnerText);
                }
                else if (node.Name == "DynamicColumns")
                {
                    LoadDynamicColumns(node, dynamicColumns);
                }
                else if (node.Name == "StaticColumns")
                {
                    LoadStaticColumns(node, staticColumns);
                }
            }
            return(cornerHeight);
        }
コード例 #10
0
 private void LoadPageSection(XmlNode pageSectionNode)
 {
     if (pageSectionNode.Name == "PageHeader")
     {
         page.PageHeader = new PageHeaderBand();
         page.PageHeader.CreateUniqueName();
         page.PageHeader.PrintOn = PrintOn.EvenPages | PrintOn.OddPages | PrintOn.RepeatedBand;
         XmlNodeList nodeList = pageSectionNode.ChildNodes;
         foreach (XmlNode node in nodeList)
         {
             if (node.Name == "Height")
             {
                 page.PageHeader.Height = UnitsConverter.SizeToPixels(node.InnerText);
             }
             else if (node.Name == "PrintOnFirstPage")
             {
                 if (node.InnerText == "true")
                 {
                     page.PageHeader.PrintOn |= PrintOn.FirstPage;
                 }
             }
             else if (node.Name == "PrintOnLastPage")
             {
                 if (node.InnerText == "true")
                 {
                     page.PageHeader.PrintOn |= PrintOn.LastPage;
                 }
             }
             else if (node.Name == "ReportItems")
             {
                 parent = page.PageHeader;
                 LoadReportItems(node);
             }
         }
     }
     else if (pageSectionNode.Name == "PageFooter")
     {
         page.PageFooter = new PageFooterBand();
         page.PageFooter.CreateUniqueName();
         page.PageFooter.PrintOn = PrintOn.EvenPages | PrintOn.OddPages | PrintOn.RepeatedBand;
         XmlNodeList nodeList = pageSectionNode.ChildNodes;
         foreach (XmlNode node in nodeList)
         {
             if (node.Name == "Height")
             {
                 page.PageFooter.Height = UnitsConverter.SizeToPixels(node.InnerText);
             }
             else if (node.Name == "PrintOnFirstPage")
             {
                 if (node.InnerText == "true")
                 {
                     page.PageFooter.PrintOn |= PrintOn.FirstPage;
                 }
             }
             else if (node.Name == "PrintOnLastPage")
             {
                 if (node.InnerText == "true")
                 {
                     page.PageFooter.PrintOn |= PrintOn.LastPage;
                 }
             }
             else if (node.Name == "ReportItems")
             {
                 parent = page.PageFooter;
                 LoadReportItems(node);
             }
         }
     }
 }