public void Add(SubReport obj) { if (FCount > (FItems.Length - 2)) { SubReport[] nobjects = new SubReport[FCount]; System.Array.Copy(FItems, 0, nobjects, 0, FCount); FItems = new SubReport[FItems.Length * 2]; System.Array.Copy(nobjects, 0, FItems, 0, FCount); } FItems[FCount] = obj; FCount++; }
public int IndexOf(SubReport avalue) { int aresult = -1; for (int i = 0; i < Count; i++) { if (FItems[i] == avalue) { aresult = i; break; } } return(aresult); }
void PrintFixedSections(bool Headers) { int pheader, pfooter; int i, pheadercount, pfootercount; Section psection; int afirstdetail; bool printit; Point MaxExtent = new Point(); bool PartialPrint; PartialPrint = false; MaxExtent.X = pagespacex; MaxExtent.Y = FreeSpace; if (Headers) { // First the global headers for (i = 0; i < GHeaders.Count; i++) { psection = GHeaders[i]; if (psection.EvaluatePrintCondition()) { asection = psection; CheckSpace(); PrintSection(false, ref PartialPrint); } } // Print the header fixed sections pheader = subreport.FirstPageHeader; pheadercount = subreport.PageHeaderCount; for (i = 0; i < pheadercount; i++) { psection = subreport.Sections[i + pheader]; if (!psection.Global) { if (psection.EvaluatePrintCondition()) { asection = psection; CheckSpace(); PrintSection(false, ref PartialPrint); } } } int index; SubReports psubreports = new SubReports(); for (i = 0; i < PendingSections.Count; i++) { psection = PendingSections[i]; index = psubreports.IndexOf(psection.SubReport); if (index < 0) { psubreports.Add(psection.SubReport); } } index = psubreports.IndexOf(subreport); if (index < 0) { psubreports.Add(subreport); } // Now prints repeated group headers for (int j = 0; j < psubreports.Count; j++) { SubReport subrep = psubreports[j]; afirstdetail = subrep.FirstDetail; for (i = subrep.GroupCount; i > 0; i--) { psection = subrep.Sections[afirstdetail - i]; if (psection.PageRepeat) { // if ((Math.Abs(subrep.CurrentGroupIndex) <= i) && (section!=psection)) // if ((Math.Abs(subreport.CurrentGroupIndex) < i)) // Group headers are printed when page repeat=true bool dopagerepeat = false; // Allways if there is another active subreport if (subrep != subreport) { dopagerepeat = true; } else { // Never if the current section is just the group header if (section != psection) { // If the section is enclosed between the header // and the footer if (CurrentSectionIndex > subrep.FirstDetail - i) { if (psection.ForcePrint) { // (footer included) if (CurrentSectionIndex <= subrep.LastDetail + i) { dopagerepeat = true; } } else { // (footer not included) if (CurrentSectionIndex < subrep.LastDetail + i) { dopagerepeat = true; } } } } } if (dopagerepeat) { if (psection.EvaluatePrintCondition()) { // Add group headers to be printed at the // main print loop (child subreports and horz/vert.desp) FGroupHeaders.Add(psection); } } } } } pagefooterpos = pageposy + FreeSpace; // Reserve space for page footers // Print conditions for footers are evaluated at the begining of // the page // Global page footers for (i = 0; i < GFooters.Count; i++) { psection = GFooters[i]; asection = psection; CheckSpace(); pagefooterpos = pageposy + FreeSpace - sectionext.Y; FreeSpace = FreeSpace - sectionext.Y; } pfooter = subreport.FirstPageFooter; pfootercount = subreport.PageFooterCount; for (i = 0; i < pfootercount; i++) { psection = subreport.Sections[i + pfooter]; if (!psection.Global) { asection = psection; havepagefooters = true; CheckSpace(); pagefooters.Add(psection); pagefooterpos = pageposy + FreeSpace - sectionext.Y; FreeSpace = FreeSpace - sectionext.Y; } } } else { // Print page footers if ((GFooters.Count > 0) || (pagefooters.Count > 0)) { pageposy = pagefooterpos; for (i = 0; i < pagefooters.Count; i++) { asection = pagefooters[i]; if (!asection.Global) { printit = true; if (!asection.ForcePrint) { if (section == null) { printit = false; } } if (printit) { if (asection.EvaluatePrintCondition()) { sectionext = asection.GetExtension(FDriver, MaxExtent, false); PrintSection(false, ref PartialPrint); FreeSpace = 0; } } } } // Global page footers for (i = 0; i < GFooters.Count; i++) { asection = GFooters[i]; printit = true; if (!asection.ForcePrint) { if (section == null) { printit = false; } } if (printit) { if (asection.EvaluatePrintCondition()) { sectionext = asection.GetExtension(FDriver, MaxExtent, false); PrintSection(false, ref PartialPrint); FreeSpace = 0; } } } } } }
public void Remove(SubReport subrep) { RemoveAt(IndexOf(subrep)); }