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

Q1 2014 ReportViewer throwing errors

5 Answers 85 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 04 Apr 2014, 06:59 PM
Guys,
This is a breaking change and I haven't yet figured out why it is happening to my project when I am upgrading to Q1 2014.
The xaml code is -
             xmlns:tr="http://schemas.telerik.com/wpf"

        <tr:ReportViewer x:Name="reportViewer" HorizontalAlignment="Stretch" Margin="10"
                         ReportSource="{Binding ReportSource}">
            <telerikControls:StyleManager.Theme>
                <telerikControls:Windows7Theme />
            </telerikControls:StyleManager.Theme>
        </tr:ReportViewer>

Application breaks in execution with message -
'The invocation of the constructor on type 'Telerik.ReportViewer.Wpf.ReportViewer' that matches the specified binding constraints threw an exception.' Line number '34' and line position '10'

I am referencing to following dlls in the project :
1. Telerik.reporting - v4.0.30319
2. Telerik.ReportViewer.Wpf - v4.0.30319
3. Telerik.Windows.Controls - v4.0.30319

5 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 09 Apr 2014, 10:54 AM
Hello Jim,

As of Q1 2014 the WPF ReportViewer uses implicit styles instead of the StyleManager to apply themes. More details how to update your project and how to troubleshoot possible issues that may appear are described in the following forum thread: Upgrade to 2014Q1 Reporting.

Let us know if you need any further help.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jim
Top achievements
Rank 1
answered on 10 Apr 2014, 12:02 AM
Hi Stef,
I tried the steps written in the article. Things are not working right.
1. Is it absolutely required to add Xaml files of themes?
2. I added 5 xaml files of Windows7Theme under Resources -> MergedDictionaries in my project's App.xaml file but I get
                 “object reference not set to an instance of an object” exception when it tries to load Telerik.Windows.Controls.xaml of that theme.
3. Is it required to assign a Source to ReportViewer? Does it use a null Source by default?
0
Stef
Telerik team
answered on 11 Apr 2014, 05:13 PM
Hi Jim,

Currently the Telerik.ReportViewer.Wpf.dll does not contain any XAML, thus you need to have a reference to the assembly and add the XAML file for the desired theme. XAML resources should be handled properly in the application resources. For more details check the How to: Add report viewer to a WPF application help article. Make sure you follow the steps I posted here.

About binding the ReportViewer.ReportSource, if it is non MVVM context, the viewer works without set ReportSource property or with ReportSource bound to Null. If setting the viewer as suggested above does not resolve the errors on build, feel free to open a support ticket and send us the project to check its settings.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jim
Top achievements
Rank 1
answered on 12 Apr 2014, 12:57 AM
Hi Stef,

It didn't worked. I have opened a support ticket.
0
Stef
Telerik team
answered on 16 Apr 2014, 10:38 AM
Hi Jim,

This is a quote from our reply to your support ticket:
....please test to give the relative paths to the XAML resources in the dictionary that will be turned into ResourceDictionary.MergedDictionaries. With the give project structure all paths should be in the format "Telerik.Reporting/Win7Theme/<resourcename>.xaml"
 
The above relative path is used to load the XAML file and suppose the Telerik.Reporting folder can be routed correctly and there can be created an URI from the given path. You can test also by providing the full paths to the resources to be sure the URI is created and files are loaded.....

If you need further help, let us continue the discussion in the ticket and we will update the thread at end for anyone concerned.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Jim
Top achievements
Rank 1
Answers by
Stef
Telerik team
Jim
Top achievements
Rank 1
Share this question
or