We're having quite a few problems with the Telerik reporting tools. Perhaps these issues are all just something we're doing wrong (and frankly we'd be happy if they were), but we're starting to believe that it's really a series of bugs in the product. This one we refer to internally as "The Incredible Shrinking WPF Report Viewer".
The Incredible Shrinking WPF Report Viewer
In our product, we host the Telerik WPF Report Viewer in a custom WPF user control (a Telerik RadWindow actually) and expose a ShowReportViewer method. What we would like to do is to activate (show) our control with the child Report Viewer and adjust the window size and placement so that the report is always clearly visible and, ideally, centered on the owner window.
Nothing exotic, right?
If we uncomment that ZoomMode line, our window will open then the ReportViewer will then immediately begin shrinking the report down to 0% one step at a time and continue to do so which means the user has to force close the app. It behaves the same as it someone were to open the window then immediately began clicking the zoom decrease arrow as fast as they could. Note that the zoom percent always starts at 13% (we have no idea why) and the behavior is the same no matter if we set the ZoomMode property value in XAML or in the code-behind.
Greg
The Incredible Shrinking WPF Report Viewer
In our product, we host the Telerik WPF Report Viewer in a custom WPF user control (a Telerik RadWindow actually) and expose a ShowReportViewer method. What we would like to do is to activate (show) our control with the child Report Viewer and adjust the window size and placement so that the report is always clearly visible and, ideally, centered on the owner window.
Nothing exotic, right?
/// <summary>
/// Shows the report viewer.
/// </summary>
/// <param name="modal">if set to <c>true</c> [modal].</param>
public
void
ShowReportViewer(
bool
modal =
false
)
{
this
.WindowStartupLocation = WindowStartupLocation.CenterScreen;
this
.TelerikReportViewer.ViewMode = ViewMode.PrintPreview;
//// Uncommenting this line results in the problem...
////this.TelerikReportViewer.ZoomMode = ZoomMode.FullPage;
this
.ShowWindow(modal);
this
.window = ParentOfTypeExtensions.ParentOfType<Window>(
this
);
this
.window.Topmost =
true
;
this
.window.ShowInTaskbar =
true
;
this
.window.Activate();
}
If we uncomment that ZoomMode line, our window will open then the ReportViewer will then immediately begin shrinking the report down to 0% one step at a time and continue to do so which means the user has to force close the app. It behaves the same as it someone were to open the window then immediately began clicking the zoom decrease arrow as fast as they could. Note that the zoom percent always starts at 13% (we have no idea why) and the behavior is the same no matter if we set the ZoomMode property value in XAML or in the code-behind.
Greg