'宣言 Public Property PageFooterTemplate As DataTemplate
public DataTemplate PageFooterTemplate {get; set;}
Private Sub SetReportSettings() Dim reportObj As New Report() Dim section As New EmbeddedVisualReportSection(XamDataGrid1) reportObj.Sections.Add(section) ' set footer template reportObj.PageFooterTemplate = TryCast(Me.Resources("PagePresenterFooterTemplate"), DataTemplate) ' set footer data reportObj.PageFooter = "MyFooter" reportObj.Print(False) End Sub
private void SetReportSettings() { Report reportObj = new Report(); EmbeddedVisualReportSection section = new EmbeddedVisualReportSection(XamDataGrid1); reportObj.Sections.Add(section); // set footer template reportObj.PageFooterTemplate = this.Resources["PagePresenterFooterTemplate"] as DataTemplate; // set footer data reportObj.PageFooter = "MyFooter"; reportObj.Print(false); }