Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
310
Different Headers/Footers on Different Pages
posted

My report has 2 different headers/footers that are used in different areas of the report.  For example, the first area of the report has a brief summary of several items (these pages have a header/footer) and the second area of the report covers each of those items in detail (these pages have a different header/footer). How do I apply the different headers/footers on certain pages of the report? Any help is greatly appreciated. 

  • 53790
    posted

    Hello Eric,

    If I understand well your requirement,  maybe one possible approach to solve this task, could be if you create two different section into your report. By this way you will be able to set different header/footer to each section. For example:

     

                Infragistics.Documents.Reports.Report.Report rep1 = new Report();

                ISection section1 = rep1.AddSection();

                Infragistics.Documents.Reports.Report.Section.ISectionHeader header = section1.AddHeader();           

                header.Height = 100;

                Infragistics.Documents.Reports.Report.Text.IText text = header.AddText(100, 0, 0);

                text.AddContent("My custom text only for PDF file");

     

                Infragistics.Documents.Reports.Graphics.Image image = new Infragistics.Documents.Reports.Graphics.Image(Resource1.IG);

                header.AddImage(image, 5,5);

     

                ISection section2 = rep1.AddSection();

                Infragistics.Documents.Reports.Report.Section.ISectionHeader header2 = section2.AddHeader();

                header2.Height = 100;

                Infragistics.Documents.Reports.Report.Text.IText text2 = header2.AddText(100, 0, 0);

                text2.AddContent("My NEWWWWWWWWWWW");

     

                rep1.Publish("..\\..\\Test22.pdf", FileFormat.PDF);

                Process.Start("..\\..\\Test22.pdf");

    Let me know if you have any questions.