This is a migrated thread and some comments may be shown as answers.

Exception in add a Telerik ReportViewer

5 Answers 233 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Albert
Top achievements
Rank 1
Albert asked on 21 Apr 2012, 04:16 AM
i try to add Telerik ReprtViewer to my window Grid
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"/>
the project works with out exceptions

Thanks in Advance ...

5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 21 Apr 2012, 08:49 AM
Hi Albert,

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 >

0
Michal
Top achievements
Rank 1
answered on 11 Jun 2012, 02:07 PM
Hello

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"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             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.
0
Hadib Ahmabi
Top achievements
Rank 1
answered on 14 Jun 2012, 11:47 AM
Try to set a breakpoint as soon as possible and step through line by line to see where it blows up, it should give more info on the matter.
0
Krzysztof
Top achievements
Rank 1
answered on 14 Jun 2012, 01:42 PM

0
Michal
Top achievements
Rank 1
answered on 14 Jun 2012, 01:47 PM
debugging didnt help me at all.
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.
Tags
General Discussions
Asked by
Albert
Top achievements
Rank 1
Answers by
Steve
Telerik team
Michal
Top achievements
Rank 1
Hadib Ahmabi
Top achievements
Rank 1
Krzysztof
Top achievements
Rank 1
Share this question
or