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

How to add a report viewer in wpf project which is already using Telerik themes?

7 Answers 147 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sumit
Top achievements
Rank 1
Sumit asked on 22 Apr 2020, 06:52 AM
I am trying to add the report viewer component in my wpf project but my application already using themes from Telerik and when I try to add report viewer by adding Xaml files in a folder and providing references of it. It shows exception. I some how need to give styling to the report viewer component with the existing theme. Any Suggestion how to do it?

7 Answers, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 24 Apr 2020, 11:20 AM

Hi Sumit,

Basically, we recommend adding the report viewer through the Item template. What was the exception? You may try to compare your project with our demo which can be found in the installation folder of Telerik Reporting: C:\Program Files (x86)\Progress\Telerik Reporting <Version>\Examples\CSharp\WpfDemo.

Note that in R1 2020, we fixed an issue related to WPF (Allow the report viewer theme to be set using resources for the current window instead of setting resources on application level). Make sure that you are using this or a newer version of Telerik Reporting.

Regards,
Neli
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Sumit
Top achievements
Rank 1
answered on 25 Apr 2020, 09:06 AM

Hi thank you so much for replying, actually I am using Telerik.windows.themes.office (no xaml) and such themes to style the whole look of the existing project like buttons, combobox etc. What is happening is that I am using Report viewer themes to style the report viewer but due to the already present themes a conflict is occurring. I am using Telerik.Reporting 2018 version as my other Dll of telerik is also of 2018 version.

I somehow need to style the report viewer without interfering with the current look of the project. Any way to do so?

0
Sumit
Top achievements
Rank 1
answered on 25 Apr 2020, 10:33 AM
I am getting xml parse exception.
0
Neli
Telerik team
answered on 29 Apr 2020, 11:17 AM

Hello Sumit,

You may test the answer from Reporting Control themes effect my Micrsoft WPF Controls in Project forum post. If this doesn't work, give us more information about the error.

Regards,
Neli
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Sumit
Top achievements
Rank 1
answered on 29 Apr 2020, 12:54 PM
Hi I tried the approach given in  the link you provided when I used that method on a new separate project it worked fine but when I am doing this in my actual project it is giving me an exception. I followed the exactly same steps. I am attaching an image of exception message.
0
Sumit
Top achievements
Rank 1
answered on 30 Apr 2020, 04:33 PM

Hi I somehow managed to get the files to load but now some another exception is coming i.e Could not load file or assembly 'Telerik.Windows.Controls.Navigation, Version=2018.3.1016.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"Telerik.Windows.Controls.Navigation, Version=2018.3.1016.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7"}

But my other components other than reporting are working fine with this DLL any suggestion please what to do?

0
Katia
Telerik team
answered on 04 May 2020, 08:17 AM

Hi Sumit,

Each version of the WPF Report Viewer depends on a specific version of Telerik UI Controls for WPF. The dependencies can be checked in the Upgrade section from our online documentation.

In case you use Telerik UI for WPF version that differs from the one specified for the corresponding release of the Telerik Reporting you have to redirect all assemblies required by the viewer to their latest versions. Here is an example of how a bindingRedirect can be used to replace the version of Telerik UI for WPF assemblies:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Telerik.Windows.Controls" culture="neutral" publicKeyToken="5803cfa389c90ce7"/>
        <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="2010.1.421.35"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Telerik.Windows.Controls.Input" culture="neutral" publicKeyToken="5803cfa389c90ce7"/>
        <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="2010.1.421.35"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Telerik.Windows.Controls.Navigation" culture="neutral" publicKeyToken="5803cfa389c90ce7"/>
        <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="2010.1.421.35"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

Regards,
Katia
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
General Discussions
Asked by
Sumit
Top achievements
Rank 1
Answers by
Neli
Telerik team
Sumit
Top achievements
Rank 1
Katia
Telerik team
Share this question
or