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
665
Report vertical page alignment
posted

It appears the vertical page allignment of  EmbeddedVisualReportSection is center. Is there a way to set it to top?

I have tried using a style with the content vertical alignment set to top but it is ignored.

  • 54937
    Suggested Answer
    Offline posted

    You should be able to provide a style for the ReportPagePresenter (via the section's PagePresenterStyle property) that sets the Horizontal|VerticalContentAlignment. However, it appears that the template is not binding to those properties currently so you will need to retemplate the page. e.g.

            <Style TargetType="{x:Type igReporting:ReportPagePresenter}" x:Key="customPageStyle">
                <Setter Property="HorizontalContentAlignment" Value="Center" />
                <Setter Property="VerticalContentAlignment" Value="Top" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type igReporting:ReportPagePresenter}">
                            <Border BorderBrush="{TemplateBinding Border.BorderBrush}" 
                                  BorderThickness="{TemplateBinding Border.BorderThickness}" 
                                  Background="{TemplateBinding Panel.Background}" 
                                  SnapsToDevicePixels="True"
                                  Padding="{TemplateBinding Padding}">
                                <DockPanel SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                    <ContentPresenter x:Name="PART_Header" ContentSource="Header" DockPanel.Dock="Top"/>
                                    <ContentPresenter x:Name="PART_Footer" ContentSource="Footer" DockPanel.Dock="Bottom"/>
                                    <ContentPresenter x:Name="PART_Content" 
                                                      HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                      VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                      ContentSource="Content" />
                                </DockPanel>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

     And then set this as the PagePresenterStyle on your section. e.g.

    section.PagePresenterStyle = this.FindResource("customPageStyle"as Style;