Telerik Forums
Reporting Forum
6 answers
138 views
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?


Kriztine
Top achievements
Rank 1
 answered on 29 Feb 2012
10 answers
177 views
Dear Telerik,

could you please consider supporting either <sub> <sup> tags or the css veritical-align attribute for the htmlTextBox.   We write a lot of reports that require footnotes and hence it is useful to subscript parts of the text in a report to achieve this.

Thanks,
Jason


Steve
Telerik team
 answered on 29 Feb 2012
1 answer
124 views
Dear Telerik Team member,

 I am using Telerik report viewer with entity fraework.
This is the code I am using to bind the report to the control.
When I run the app. I am unable to see the result on the reportviewer, but I am able to get the result set from database.
Where am I doing wrong?
Help me please...

   Telerik.Reporting.EntityDataSource entityDataSource = new 
Telerik.Reporting.EntityDataSource();         <BR>            
entityDataSource.ObjectContext = 
typeof(MyEntities);<BR>            
entityDataSource.ObjectContextMember = 
"ReportSales";<BR>            
entityDataSource.Parameters.AddRange(new 
Telerik.Reporting.ObjectDataSourceParameter[] 
{<BR>            new 
Telerik.Reporting.ObjectDataSourceParameter("SalesID", 
typeof(System.Nullable<int>),18),<BR>            
new Telerik.Reporting.ObjectDataSourceParameter("category", 
typeof(System.Nullable<byte>), 
1)});<BR>            
<BR>            
Telerik.Reporting.Report report = new 
Telerik.Reporting.Report();<BR>            
report.DataSource = 
entityDataSource;<BR>           
<BR>            
this.DefaultReportViewer.Report = report;
Steve
Telerik team
 answered on 29 Feb 2012
1 answer
383 views
Hi all,

My scenario is to place a picture, uploaded by a user.
The picture can be any size, so, I want it to show as much of it as possible.

I have tried different sizetypes, and autosize seems to work the best for me.

The problem - which is a big issue - is, when the picture is wider than the page size. It makes the document contain blank pages on every other page, except the page with the right part of the picture.
This behavior is natural...

What I wanted the most, is some kind of maxsize along with the autosize setting.
Or is there an other recommandation.

Kind regards,
Morten
Elian
Telerik team
 answered on 29 Feb 2012
3 answers
810 views
Hi,

I've been searching online for solutions that can solve my problem but most had to do with Master Details relationships.

My problem in a nutshell.

I have one Master report, the header and footer are populated with one datatable named CompanyInformation. In the details section, I have a telerik.reporting.processing.table, I set the headers and inside the table cells I drag a textbox. I set the value of the textbox to be the corresponding field from the database starting with "[=Field.something]." I bind the header and footer alright but the table will not show up at all and yes the visibility is set to true. By the way, both the master and table datasources are being set at runtime determined by a parameter passed from within an asp.net application.

heres my code.

    private void TelerikReportInvoice_NeedDataSource(object sender, EventArgs e)
        {

            int param = (int)this.ReportParameters["param "].Value;

            InvoiceDataSetTableAdapters.GetOrdersTableAdapter adapter = new TelerikReport.InvoiceDataSetTableAdapters.GetOrdersTableAdapter();
           
InvoiceDataSet.GetOrdersDataTable dt= new InvoiceDataSet.GetOrdersDataTable();
            dt= adapter.GetData(param);

            ((Telerik.Reporting.Processing.Report)sender).DataSource = dt.AsDataView();

        }

        private void table2_NeedDataSource(object sender, EventArgs e)
        {
            InvoiceDataSetTableAdapters.GetOrderFeesTableAdapter adpt = new TelerikReport.InvoiceDataSetTableAdapters.GetOrderFeesTableAdapter();

            InvoiceDataSet.GetOrderFeesDataTable dt= new InvoiceDataSet.GetOrderFeesDataTable();

            int param = (int)this.ReportParameters["param"].Value;  //same as master parameter

            dt= adpt.GetData(param);
            table2.DataSource = dt.AsDataView();

        }

I set both the table and report's datasource to be null in the constructor after initializecomponent() is called. The DataSet Visualizer also shows that there are 2 rows in the datatable returned and i'm also using stored procedures.

Thanks.


Hadib Ahmabi
Top achievements
Rank 1
 answered on 29 Feb 2012
1 answer
112 views
There are basically 2 ways to display a grouping.  In a report, you can display it with the group titles in their own row like this:

Group 1
    XXXXXXX   XXXXXXX   XXXXXXX
    XXXXXXX   XXXXXXX   XXXXXXX
Group 2
    XXXXXXX   XXXXXXX   XXXXXXX

In a crosstab, you can display it with the group titles as a column. Like this:
Group 1     XXXXXXXX   XXXXXXXX   XXXXXXXX
                  XXXXXXXX   XXXXXXXX   XXXXXXXX
Group 2     XXXXXXXX   XXXXXXXX   XXXXXXXX

Is there a way to do both in the same report?
i.e.

Grouping 1
      SubGroup 1     XXXXXXXX   XXXXXXXX   XXXXXXXX
                              XXXXXXXX   XXXXXXXX   XXXXXXXX
      SubGroup 2     XXXXXXXX   XXXXXXXX   XXXXXXXX
                              XXXXXXXX   XXXXXXXX   XXXXXXXX
Grouping 2
      SubGroup 1     XXXXXXXX   XXXXXXXX   XXXXXXXX
                              XXXXXXXX XXXXXXXX XXXXXXXX
      SubGroup 2     XXXXXXXX   XXXXXXXX   XXXXXXXX


I can't seem to find a way to do this with a crosstab or with the report group explorer.
Thanks,
Justin
Hadib Ahmabi
Top achievements
Rank 1
 answered on 29 Feb 2012
1 answer
217 views
Hello,

I have a grid list which I have checkboxes to select the rows.
My report have data that I need to bring from database.
Today, we have a button/link that sends the IDs of the rows as parameters and then it's displayed the ReportViewer in another screen.

We want to make this button to print the report automatically without displaying the ReportViewer.

Thanks,
Ezequiel



IvanY
Telerik team
 answered on 29 Feb 2012
1 answer
92 views
When trying to print a report (also occurs on demo site: http://demos.telerik.com/reporting/invoice-report/demo.aspx) in IE 7 browser, the user is prompted to save the PDF instead of being presented with the printer object window.


See screen shot attached - prompts user to save pdf file instead of printing.
Thanks,
Mike
Steve
Telerik team
 answered on 29 Feb 2012
2 answers
80 views
Same as http://www.telerik.com/community/forums/reporting/telerik-reporting/error-adding-new-telerik-report-to-solution.aspx 

But I was in the VS2012 website project.

Do you have the "Telerik_Reporting_Q1_2012.zip" for web?

Thanks a lot! 
bin zhu
Top achievements
Rank 1
 answered on 29 Feb 2012
3 answers
132 views
I've got a Lightswitch app that consumes a report from our IIS hosted Telerik reporting WCF service, and it was working fine on 2011 Q3. I'm trying to update it to Q1 2012 and now I'm getting the following error:

The property 'Theme' does not exist on the type 'ReportViewer' in the XML namespace 'http://schemas.telerik.com/2008/xaml/presentation'.

What causes this?

Thanks
Steve
Telerik team
 answered on 28 Feb 2012
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?