Beispiel #1
0
        /// <summary>
        /// Creates a ReportSummaryBand instance in the specified ReportPage.
        /// </summary>
        /// <param name="page">The ReportPage instance.</param>
        /// <returns>The ReportSummaryBand instance.</returns>
        public static ReportSummaryBand CreateReportSummaryBand(ReportPage page)
        {
            ReportSummaryBand reportSummary = new ReportSummaryBand();

            page.ReportSummary = reportSummary;
            reportSummary.CreateUniqueName();
            return(reportSummary);
        }
        private void LoadReportFooterBand() // Report Summary
        {
            string name = FindObjectName(REPORT_FOOTER_BAND_MASK);

            if (!String.IsNullOrEmpty(name))
            {
                ReportSummaryBand summary     = ComponentsFactory.CreateReportSummaryBand(page);
                string            description = GetObjectDescription(name);
                LoadBand(summary, description);
                LoadObjects(description, summary);
            }
        }
Beispiel #3
0
        private void LoadReportFooterBandXml()
        {
            XmlNode node = FindBandNode("ReportFooterBand");

            if (node == null)
            {
                return;
            }
            ReportSummaryBand summary = ComponentsFactory.CreateReportSummaryBand(page);

            LoadBand(node, summary);
            LoadObjects(node, summary);
        }
        // get a list of the footers that must be kept with the dataBand row
        private List <HeaderFooterBandBase> GetAllFooters(DataBand dataBand)
        {
            // get all parent databands/groups
            List <BandBase> list = new List <BandBase>();

            EnumHeaders(dataBand, list);

            // add report summary if required
            ReportSummaryBand summaryBand = (dataBand.Page as ReportPage).ReportSummary;

            if (dataBand.KeepSummary && summaryBand != null)
            {
                list.Add(summaryBand);
            }

            // make footers list
            List <HeaderFooterBandBase> footers = new List <HeaderFooterBandBase>();

            foreach (BandBase band in list)
            {
                HeaderFooterBandBase footer = null;
                if (band is DataBand)
                {
                    footer = (band as DataBand).Footer;
                }
                else if (band is GroupHeaderBand)
                {
                    footer = (band as GroupHeaderBand).GroupFooter;
                }
                else if (band is ReportSummaryBand)
                {
                    footer = band as ReportSummaryBand;
                }

                if (footer != null)
                {
                    footers.Add(footer);
                }

                // skip non-last data rows. Keep the dataBand to allow
                // calling this method from the beginning of RunDataBand
                if (band != dataBand && !band.IsLastRow)
                {
                    break;
                }
            }

            // remove all footers at the end which have no KeepWithData flag
            for (int i = footers.Count - 1; i >= 0; i--)
            {
                if (!footers[i].KeepWithData)
                {
                    footers.RemoveAt(i);
                }
                else
                {
                    break;
                }
            }

            return(footers);
        }