バージョン

PageHeaderTemplate プロパティ (ReportSection)

ReportPagePresenter コントロールのヘッダー コンテンツを表示するために使用されるテンプレート。
シンタックス
'宣言
 
Public Property PageHeaderTemplate As DataTemplate
public DataTemplate PageHeaderTemplate {get; set;}
解説

注: このプロパティは、ReportBaseReportBase.PageHeaderTemplate 設定を優先させます。

使用例
Apply DataTemplate to section's properties.
Private Sub SetReportSettings()
    Dim reportObj As New Report()
    Dim section As New EmbeddedVisualReportSection(XamDataGrid1)
    reportObj.Sections.Add(section)
    
    ' set Header template for section only 
    section.PageHeaderTemplate = TryCast(Me.Resources("PagePresenterHeaderTemplate"), DataTemplate)
    ' set Header data for section only 
    section.PageHeader = "MyHeader"
    reportObj.Print(False)
End Sub
Apply DataTemplate to section's properties.
private void SetReportSettings()
{
	Report reportObj = new Report();
	EmbeddedVisualReportSection section = new EmbeddedVisualReportSection(XamDataGrid1);
	reportObj.Sections.Add(section);
	
	// set Header template for section only 
	reportObj.PageHeaderTemplate = this.Resources["PagePresenterHeaderTemplate"] as DataTemplate;
	// set Header data for section only 
	reportObj.PageHeader = "MyHeader";
	reportObj.Print(false);
}
Define DataTemplate as resource and bind the ReportPagePresenter's page numbers properties to any content presenter to display appropriate page number.
<Page  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
xmlns:igRep="http://infragistics.com/Reporting"  

>
<Page.Resources>
    <!-- DataTemplate for page Header-->
    <DataTemplate x:Key="P
agePresenterHeaderTemplate">
        <Grid Height="50" HorizontalAlignment="Stretch" >

            
<Grid.RowDefinitions>
                <RowDefinition Height="12"/>
                <RowDefinition/>
            </G
rid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="5*"/>
                <C
olumnDefinition Width="*"/>
            
</Grid.ColumnDefinitions>
            
<Border BorderThickness="1" BorderBrush="Black" Height="2" Margin="20,0,20,0" VerticalAlignment="Top" Grid.ColumnSpan="2" />
            
<Label Grid.Row="1" Grid.Column="1" Content="{Binding Path=PhysicalPageNumber,
                RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type igRep:ReportPagePresenter}}}"
 Padding="0" />
            
<Label Grid.Row="1" Content="{Binding}" Padding="0" HorizontalContentAlignment="Center" />
        
</Grid>
    
</DataTemplate>
</Page.Resources>
</Page>
参照