Hi All,
I am trying to print page number in Report Header or change the report header content dynamically using an event PrintProgress. I have following code inside that event:-
((Report)sender).PageHeader = e.CurrentPageNumber.ToString();
I am getting the right value inside the event for each page. But when i preview the page using DocumentViewer i am not getting the page number at all.
Following is the snippit of my code.
Report reportObj = new Report();
EmbeddedVisualReportSection section = new EmbeddedVisualReportSection(xamPresenter);
reportObj.PrintProgress += new EventHandler<Infragistics.Windows.Reporting.Events.PrintProgressEventArgs>(reportObj_PrintProgress);
reportObj.Sections.Add(section);
xamReportPreview.GeneratePreview(reportObj, false, false);
xamReportPreview.IsContentVisible = true;
DocumentViewer docv = xamReportPreview.DocumentViewer;
What am i doing wrong here.
Thanks
miztaken
The total of the printed pages can be accessed in the PrintEnded event of the Report object, but currently to get that information printed you'd need to generate the report twice. Please, refer to the following forum thread:
http://community.infragistics.com/forums/p/27584/103606.aspx#103606
Thanks. It did the trick.
Also is there any way to know the total pages before changing the header?? I want to display like this as a header:-
Page X of Y
Hi miztaken,
In order to show page numbers you'll need to customize a little the header/ footer of your report. There's a very good example for that in our Feature Browser under "Reporting > Themes and Custom Styles > Customizing the Header and Footer".
Hope this helps.