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
Hi Sumeet,
I was wondering if you had any further questions on this topic.
Please let me know if I can be of any further assistance.
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.