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

WPF ReportViewer Inheritance

2 Answers 80 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
developer
Top achievements
Rank 1
developer asked on 12 Nov 2014, 10:58 AM
Hi guys.

I need to have a localized ReportViewer, so i tried to inherit from Telerik.ReportViewer.Wpf.Reportviewer. I know that there are many workarounds to localize the control without inheritance, but I think that in my situation is the best way.

So, i tried to inherit from Telerik.ReportViewer.Wpf.Reportviewer, I created a class that implements the ITextResources interface and I tried to use the control, but it doesn't appear on the window anymore!

(I was using implicit style for the control in this way)
<ns:myReportViewer>
   <ns:myReportViewer.Resources>
       <ResourceDictionary>
           <ResourceDictionary.MergedDictionaries>
               <ResourceDictionary Source="/Resources/Themes/System.Windows.xaml"/>
               <ResourceDictionary Source="/Resources/Themes/Telerik.Windows.Controls.xaml"/>
               <ResourceDictionary Source="/Resources/Themes/Telerik.Windows.Controls.Input.xaml"/>
               <ResourceDictionary Source="/Resources/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
               <ResourceDictionary Source="/Resources/Themes/Telerik.ReportViewer.Wpf.xaml"/>
             </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
        </ns:myReportViewer.Resources>
</ns:myReportViewer>

2 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 14 Nov 2014, 04:23 PM
Hello,

As of Q1 2014 Telerik Reporting WPF/Silverlight ReportViewer controls use only implict styles. For more details please refer to the Setting a theme of the WPF/Silverlight Report Viewer (Q1 2014 and later) blog post and How to: Add report viewer to a WPF application help article.

About localizing the WPF ReportViewer, you can check the general approaches listed in the Report Viewer Localization help article.


I hope the above information helps you.

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
developer
Top achievements
Rank 1
answered on 27 Nov 2014, 11:25 AM
I solved my problem, this was the solution:

If you don't use Implicit Style on a ReportViewer it won't be displayed on the Window.
When I tried to apply Implicit Style on my inherited ReportViewer nothing happened because my control wasn't a Telerik ReportViewer anymore, so I had do define a new Implicit Style for my ReportViewer cloning the Telerik.ReportViewer.Wpf.xaml file and then everything works fine!
Tags
General Discussions
Asked by
developer
Top achievements
Rank 1
Answers by
Stef
Telerik team
developer
Top achievements
Rank 1
Share this question
or