void HandleSectionEvents(object sender, SectionEventArgs e)
        {
            var sectionName = e.Section.Name;

            if (sectionName == ReportSectionNames.ReportHeader)
            {
                var param1 = (BaseTextItem)e.Section.Items.FirstOrDefault(n => n.Name == "Param1");
//				FileInfo fi =new FileInfo(FileNames[0]);
//			var s = fi..Directory + fi.Name;
                param1.Text = FileNames[0];
                var param2 = (BaseTextItem)e.Section.Items.FirstOrDefault(n => n.Name == "Param2");
                param2.Text = list.Count.ToString();
            }

            else if (sectionName == ReportSectionNames.ReportPageHeader)
            {
                Console.WriteLine("PushPrinting :" + ReportSectionNames.ReportPageHeader);
            }

            else if (sectionName == ReportSectionNames.ReportDetail)
            {
//				Console.WriteLine("PushPrinting :" + ReportSectionNames.ReportDetail);
            }

            else if (sectionName == ReportSectionNames.ReportPageFooter)
            {
//				Console.WriteLine("PushPrinting :" + ReportSectionNames.ReportPageFooter);
            }

            else if (sectionName == ReportSectionNames.ReportFooter)
            {
//				Console.WriteLine("PushPrinting :" + ReportSectionNames.ReportFooter);
            }
        }
Example #2
0
        protected IExportContainer CreateSection(IReportContainer container, Point location)
        {
            var sea = new SectionEventArgs(container);

            Raise <SectionEventArgs> (SectionRendering, this, sea);
            var containerConverter = new ContainerConverter(location);
            var convertedContainer = containerConverter.ConvertToExportContainer(container);

            var list = containerConverter.CreateConvertedList(container.Items);

            containerConverter.SetParent(convertedContainer, list);
            convertedContainer.ExportedItems.AddRange(list);

            convertedContainer.DesiredSize = MeasureElement(convertedContainer);
            ArrangeContainer(convertedContainer);
            return(convertedContainer);
        }
        protected IExportContainer CreateSection(IReportContainer container, Point location)
        {
            var sea = new SectionEventArgs(container);

            Raise <SectionEventArgs> (SectionRendering, this, sea);
            var containerConverter = new ContainerConverter(location);
            var convertedContainer = containerConverter.ConvertToExportContainer(container);

            var list = containerConverter.CreateConvertedList(container.Items);

            containerConverter.SetParent(convertedContainer, list);
            convertedContainer.ExportedItems.AddRange(list);
            //Run ExpressionEvaluator for every section, otherwise measure don't work
            ExpressionRunner.Visitor.Visit(convertedContainer as ExportContainer);
            convertedContainer.DesiredSize = MeasureElement(convertedContainer);
            ArrangeContainer(convertedContainer);
            return(convertedContainer);
        }