Customization of ReportViewer's User Interface

Attachment:

Generic.xaml contains the markup of ReportViewer control's template.

For example, we need to change "No report to display" text in our ReportViewer.

In Generic.xaml we find "NoReportPresenter" style, make some change and put the code into our MainPage.xaml:

<rss:ReportViewer x:Name="reportViewer">
    <rss:ReportViewer.Resources>
        <!-- NoReportPresenter -->
        <Style TargetType="rss:NoReportPresenter">
            <Setter Property="Template">
                <Setter.Value>
                   <ControlTemplate TargetType="rss:NoReportPresenter">
                        <Grid x:Name="Root" Cursor="Arrow" Width="2000"
                                                         Height="2000">
                            <Rectangle Fill="LightGray"/>
                            <TextBlock Text="Report. Coming soon."
                                           VerticalAlignment="Top"
                                        HorizontalAlignment="Left">
                            </TextBlock>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </rss:ReportViewer.Resources>            
</rss:ReportViewer>

This example also shows how to enable mouse cursor in specified area while report is not displaying.

Cursor="Arrow" Width="2000" Height="2000"

By default it is disabled.

Add Feedback