this is the code :
<
Window
x:Class
=
"MCCHomeWork.Main"
xmlns:vm
=
"clr-namespace:MCCHomeWork"
xmlns:trr
=
"http://schemas.telerik.com/wpf"
Title
=
"Main"
Height
=
"300"
Width
=
"529"
>
<
Grid
Name
=
"MyGrid"
>
<
trr:ReportViewer
Name
=
"rep1"
/>
<
Button
Content
=
"Click"
Name
=
"button3"
Width
=
"75"
Height
=
"100"
Click
=
"button3_Click"
/>
</
Grid
>
</
Window
>
it display an exception in the run time that say :
Set property 'System.Windows.ResourceDictionary.DeferrableContent' threw an exception.
the cursor point to the InitializeComponent(); in the Window Constructor
& when i remove the line :
<
trr:ReportViewer
Name
=
"rep1"
/>
Thanks in Advance ...
5 Answers, 1 is accepted
Please check out the How to: Add report viewer to a WPF application help article that elaborates on the topic, make sure that you are not using the .NET Client Profile as target framework and have referenced the following assemblies:
- Telerik.Windows.Controls.dll
- Telerik.Windows.Controls.Input.dll
- Telerik.Windows.Controls.Navigation.dll
- Telerik.Windows.Data.dll
Additionally you can review the WPF demo that came with your installation of Telerik Reporting. (start -> All Programs -> Telerik -> Reporting Q1 2011 -> Visual Studio 2010 Examples ). You can compare the differences between your project and the available demo and if you are unable to identify the problem, please provide us with a sample project that exhibits the issue.
P.S. If you are using Prism, make sure it is the latest version as we've seen problems with older releases.All the best,
Steve
the Telerik team
BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >
I have the same issue that Albert.
I cannot use ReportViewer, becouse the exception is being thrown in InitializeComponent method. I can see the visualization of the control in the designer mode, there are no errors in code, but after running app i meet an exception.
I followed http://www.telerik.com/help/reporting/wpf-report-viewer-embedding-the-viewer.html tutorial step by step.
I also compared my application to the example one and it seems that Im not missing anything.
Also I want to add that at start I didnt see ReportViewer in the toolbar and I added it in the way it was mentioned in the tutorial.
I also tried other teleric controls (such like RadClock, RadDataPager, RadColorPicker, RadCalendar) which are working fine and dont cause the exception.
the code i use is
<
UserControl
x:Class
=
"someNamespace.PdfReportViewer"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"300"
xmlns:tr
=
"http://schemas.telerik.com/wpf"
>
<
Grid
Name
=
"mainGrid"
>
<
tr:ReportViewer
/>
</
Grid
>
</
UserControl
>
some usings....
using Telerik.ReportViewer.Wpf;
namespace someNamespace
{
/// <
summary
>
/// Interaction logic for PdfReportViewer.xaml
/// </
summary
>
public partial class PdfReportViewer : UserControl
{
public PdfReportViewer()
{
InitializeComponent();
}
}
}
Thanks in advance for any help.
It was some kind of issue with our application:
It turned out that in our project one of the refferences which should be added automatically after adding ReportViewer to the project, was not added.
The missing library was: TelericInstallPath\Bin\Telerik.ReportViewer.Wpf.dll
I noticed it after creating complete new project and adding reportViewer to it. I was surprised that everything woks OK, when in my main application it is not. after looking what could have gone wrong I noticed that in my main project I'm missing this Reference.
I tried to add ReportViewer one more time to NewProject and my main Project, In both cases I was following same steps (adding ReportViewer to the toolbox, dragging RV to XAML design , adding references to Controls, Input, Navigation, Data) but again in NewProject this referrence was added automatically, and in my Main application it was not.