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

Exception when setting a theme

6 Answers 117 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kriztine
Top achievements
Rank 1
Kriztine asked on 29 Feb 2012, 02:57 PM
Hi, 

I am trying to set the theme of Silverlight Report Viewer control, but I keep on getting an exception.

Here is the xaml:
<navigation:Page x:Class="TestSilverlightApplication.ReportGeneration" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" 
           xmlns:telerik="clr-namespace:Telerik.ReportViewer.Silverlight;assembly=Telerik.ReportViewer.Silverlight" 
           xmlns:telerikControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
           d:DesignWidth="640" d:DesignHeight="480"
           Title="ReportGeneration Page">
    <Grid x:Name="LayoutRoot" >
        <Grid.RowDefinitions>
            <RowDefinition Height="29" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal">
            <TextBox Name="txtSelect" Text="Select * from Con_1_Document" Width="500" />
            <Button Content="Generate" Name="btnGenerate" Click="btnGenerate_Click" />
        </StackPanel>
        <telerik:ReportViewer  x:Name="ReportViewer1" Width="1000"
              telerikControls:StyleManager.Theme="Vista"
              ReportServiceUri="../ReportService.svc"
              Grid.Row="1"  >
        </telerik:ReportViewer>
    </Grid>
</navigation:Page>

And the exception detail:
System.Reflection.TargetInvocationException was unhandled by user code
  Message=Exception has been thrown by the target of an invocation.
  StackTrace:
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Delegate.DynamicInvokeImpl(Object[] args)
       at System.Delegate.DynamicInvoke(Object[] args)
       at ReportViewerxaml.BindingOperation(Object BindingState, Int32 , Action )
  InnerException: System.InvalidCastException
       Message=Specified cast is not valid.
       StackTrace:
            at Telerik.ReportViewer.Silverlight.ZoomConverter.Convert(Object value, Type targetType, Object parameter, CultureInfo culture)
            at System.Windows.Data.BindingExpression.ConvertToTarget(Object value)
            at System.Windows.Data.BindingExpression.UpdateTemporaryValue()
            at System.Windows.Data.BindingExpression.GetValue(DependencyObject d, DependencyProperty dp)
            at System.Windows.DependencyObject.EvaluateExpression(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry)
            at System.Windows.DependencyObject.EvaluateBaseValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
            at System.Windows.DependencyObject.EvaluateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry newEntry, ValueOperation operation)
            at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
            at System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp)
            at System.Windows.Data.BindingExpression.SendDataToTarget()
            at System.Windows.Data.BindingExpression.SourceAcquired()
            at System.Windows.Data.Debugging.BindingBreakPoint.<>c__DisplayClass4.<BreakOnSharedType>b__3()
       InnerException: 


I am also getting that exception even when I just put a background. 
Am I missing something?


6 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 29 Feb 2012, 03:11 PM
Hi Mae,

We have introduced a change to the ZoomConverter due to the Silverlight report viewer localization we introduced in the Q1 2012 release. The error you get can be caused if you've extracted the viewer template from prior version, which would not longer be valid with the upgrade to the new version. You would need to extract the new template from the Q1 2012 version and apply your customizations on it. Another possible reason is if you have not upgraded correctly to the new version. As the Silverlight report depends on RadControls for Silverlight assemblies which contain the viewer's template, you need to update those assemblies as well to the Q1 2012 version of RadControls for Silverlight. If you have installed the Visual Studio examples shipped with the product, you can find the assemblies in C:\Program Files (x86)\Telerik\Reporting Q1 2012\Examples\CSharp\SilverlightDemo\bin.

Greetings,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
0
Kriztine
Top achievements
Rank 1
answered on 29 Feb 2012, 03:48 PM
Thanks for the quick response!

We are using RadControls for Silverlight Q1 2011 SP1. So, do I need to uninstall the latest reporting version? Can you direct me to the same/compatible reporting version? 

Many thanks!
0
Steve
Telerik team
answered on 29 Feb 2012, 03:53 PM
Hello Mae,

I've already pointed you to the appropriate version in my previous post - Q1 2012 version.

Greetings,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
0
Kriztine
Top achievements
Rank 1
answered on 29 Feb 2012, 03:59 PM
Ah yes, but assuming that we are not upgrading to the latest version and keep on using Rad Controls Q1 2011 SP1, so I am needing the same reporting version, right? Is it still available for download?
0
Accepted
Steve
Telerik team
answered on 29 Feb 2012, 04:48 PM
Hello Mae,

If you have not downloaded Telerik Reporting Q1 2011, then no, it would not be available for download in your account. If you do not wish to upgrade (although we always recommend using the latest & greatest version), you can contact our friendly sales department and request they add a trial license of Telerik Reporting Q1 2011 to your account, so you would be able to download it.

Kind regards,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
0
Kriztine
Top achievements
Rank 1
answered on 29 Feb 2012, 05:04 PM
Okay, thank you so much for the help!
Tags
General Discussions
Asked by
Kriztine
Top achievements
Rank 1
Answers by
Steve
Telerik team
Kriztine
Top achievements
Rank 1
Share this question
or