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

WPF Report Viewer wont work!

1 Answer 204 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sameh
Top achievements
Rank 1
Sameh asked on 24 Aug 2018, 03:01 PM

Dear Sir/Madam, 

4 hours search, downloading, trying and can't find the solution to make WPF report viewer works with the latest Telerik version of WPF and Reporting

Framework: 4.7.1

Telerik WPF version: 2018.2.620.45

Telerki Report Version: 12.1.18.620

Basically,  New Blank telerik WPF Project -> All references are added -> Version 2018.2.620.45 (tried both, xaml and noxaml)

- Now Add Telerik Report R2 2018 (Blank)

- Then Add Telerik Report Viewer Window R2 2018

- Select Embedded, Existing Report definition, Type Report Definition, (wait for build to done) ->  Report1

- Finish: In the Log page got this error:

 

Error: Fail to add project reference System.Runtime.InteropServices.COMException (0x80004005): Adding 'TelerikWpfApp6' as a project-to-project reference would cause this project to reference itself. at VSLangProj.References.AddProject(Project pProject) at Telerik.Reporting.Vs.Common.ProjectManager.TryAddProjectReference(Project projectToReference)

 

and when I run the project i got:

 

System.Windows.Markup.XamlParseException: ''Set property 'System.Windows.ResourceDictionary.Source' threw an exception.' Line number '65' and line position '10'.'

FileNotFoundException: Could not load file or assembly 'Telerik.ReportViewer.Wpf.Themes, Culture=neutral' or one of its dependencies. The system cannot find the file specified.

 

While Telerik.ReportViewer.Wpf.Themes is in the reference.

 

 

Many thanks.

 

 

1 Answer, 1 is accepted

Sort by
0
Silviya
Telerik team
answered on 29 Aug 2018, 08:29 AM
Hello Sameh,

The first error is indicating that the project cannot reference itself. That might be possible if reports and the report viewer are in the same project.
In case you choose to use the Visual Studio Report Designer and store your reports as .NET classes, our general recommendation is to structure your reporting solution by creating a class library that contains your reports (.cs files) and then reference that class library in the application where Report Viewer is in order to view the reports. This solution structure decouples your program logic from the report and its data. At the end, you'll have the structure like the example one, provided in Visual Studio Solution Structure section of the help article.

Note that starting with Telerik Reporting R2 2018 SP1 (12.1.18.620) the Themes are provided with the Telerik.ReportViewer.Wpf.Themes assembly, and it should be available in the bin folder of the application. Hence, the property Copy Local of the assembly should be set to True - the default is False.
For more information, check How to: Migrate to embedded styles help article.

Regards,
Silviya
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Sameh
Top achievements
Rank 1
Answers by
Silviya
Telerik team
Share this question
or