Ejemplo n.º 1
0
        public ReportTable(XReportTable xmlTable,
                           IFormulaProvider formulaProvider,
                           ReportDataProvider reportDataProvider)
        {
            if (xmlTable == null)
            {
                throw new ArgumentNullException("xmlTable");
            }
            if (formulaProvider == null)
            {
                throw new ArgumentNullException("formulaProvider");
            }
            if (reportDataProvider == null)
            {
                throw new ArgumentNullException("reportDataProvider");
            }

            Name = xmlTable.Name;
            ReportGroups = new List<ReportGroup>();

            foreach (var xmlGroup in xmlTable.Groups)
            {
                var reportGroup = new ReportGroup(xmlGroup, formulaProvider, reportDataProvider);
                ReportGroups.Add(reportGroup);
            }
        }
Ejemplo n.º 2
0
        public static ReportGroup Unify(ICollection<ReportGroup> reportGroups)
        {
            if (reportGroups == null || reportGroups.Count == 0)
            {
                throw new ArgumentException("reportGroups");
            }

            CheckNames(reportGroups);

            var newGroup = new ReportGroup
            {
                Name = reportGroups.First().Name,
                ReportRows = new List<ReportRow>()
            };

            for (var i = 0; i < reportGroups.First().ReportRows.Count; i++)
            {
                var collection = GetRowsCollection(reportGroups, i);
                newGroup.ReportRows.Add(ReportRow.Unify(collection));
            }

            return newGroup;
        }