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
710
Xam Data Gris Page Header
posted

Hi,

I am printing XamDataGrid to pdf using Infragistics.Windows.Reporting.Report.

When I set the PageHeader property the PageHeader gets printed on all the pages

What I want to do here is print the PageHeader only on the first page of the printed report.

Can some one please help me acheive this.

Thanks

Sumeet

  • 12875
    Suggested Answer
    posted

    Hi Sumeet,

    You could define a Page Header for only the first page of the report by using the PrintProgress event as follows.  Take a look at the WPF feature browser sample for the Customizing the Header and Footer sample in the Style section of the Reporting control.   I think it will be helpful.

     

    report1.PrintProgress += new EventHandler<Infragistics.Windows.Reporting.Events.PrintProgressEventArgs>(report1_PrintProgress);

     

    void report1_PrintProgress(object sender, Infragistics.Windows.Reporting.Events.PrintProgressEventArgs e)

    {

        Report rpt = sender as Report;

        if (e.CurrentPageNumber != 1)

           rpt.PageHeaderTemplate = this.TryFindResource("PagePresenterHeaderTemplate") as DataTemplate;

        else

           rpt.PageHeaderTemplate = null;

    }   

     

    And if you need to show the field headers only on the first page you should set the ReportSettings's RepeatType to FirstOccurrence so that the field headings appear on the first page only.

     

    Please let me know if you have any questions.