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

Problems about using report in Silverlight Application

15 Answers 236 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Yao Naiming
Top achievements
Rank 1
Yao Naiming asked on 10 Sep 2010, 07:37 AM
Hello:
     When I use report in my silverlight appliction,there is always an error like this :"An exception occurred during the operation, making the result invalid.  Check InnerException for exception details".My report's datasource is objectdatasource,it can be previewed in the report class library,but when i use it in the silverlight application,an exception will be occured as above.However,when my report's datasource is sqldatasource,there is no error or exception and it will return right result.I don't known if i miss some dll or other files in my silverlight application.
My development environment: Windows Server 2008; VS2010; Silverlight 4.0; Reporting Q2 2010

Please write back as soon as possible!



                                                                                                                                                                                                     Thanks!

15 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 13 Sep 2010, 03:41 PM
Hello Yao Naiming,

The exception thrown in the viewer is a generic one and it might be due to various reasons.

In order to get more information about the actual problem try the following:

  • show the Output window in Visual Studio and check whether there is an exception when you're running your application in debug mode.
  • access the .svc file directly in your browser to see if it reports any problems.
  • enable the CLR exceptions from Debug --> Exceptions menu in Visual Studio and run your project in debug.
Additionally, you have a sample at your disposal - the Visual Studio examples we install along with the product. You can review the demo Silverlight application and compare what the differences are.

Best wishes,
Steve
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Yao Naiming
Top achievements
Rank 1
answered on 14 Sep 2010, 03:15 AM
Hello Steve,
Thanks for your reply. I have done as what you said, but i still get the same exception and anything else was not found. I have reviewed the demo Silverlight application and the ReportLibrary. In the DataBing folder, i find the class Cars definition. The differences between class Cars and my own class Crops is that, class Cars' data is static, but my class Crops' data is got dynamicly from the Database SQL Server 2008. You can see my class Crops definition in the code snippets.
public class Crop 
    {
        public int CropKey { get; set; }
        public string CropName { get; set; }
        public string TimeKey { get; set; }
        public string Location { get; set; }
    }
  
 public class Crops : List<Crop>
    {
        public Crops()
        {
            CropData crop;
            string connStr = "Data Source=teamsrv1;Initial Catalog=APQSEWS_Volume1;User ID=sa;Password=123456";
            string strSql = "select * from Fact_CropProduction";
            SqlConnection Conn = new SqlConnection(connStr);
            SqlDataAdapter Da = new SqlDataAdapter(strSql, Conn);
            DataTable dataTable = new DataTable();
            Da.Fill(dataTable);
              
            for (int i = 0; i < dataTable.Rows.Count; i++)
            {
                crop = new CropData();
                crop.TimeKey = dataTable.Rows[i]["DimTimeKey"].ToString();
                  crop.CropKey = Int32.Parse(dataTable.Rows[i]["DimCropProductionKey"].ToString());
                string strSql1 = "select * from Dim_CropProduction where [Key]='" + crop.CropKey + "'";
                SqlDataAdapter Da1 = new SqlDataAdapter(strSql1, Conn);
                DataTable dataTable1 = new DataTable();
                Da1.Fill(dataTable1);
                for (int j = 0; j < dataTable1.Rows.Count; j++)
                {
                    int temCropDepth = Int32.Parse(dataTable1.Rows[0]["Depth"].ToString());
                    switch (temCropDepth)
                    {
                        case 1:
                            crop.CropName = dataTable1.Rows[0]["Level1"].ToString();
                            break;
                        case 2:
                            crop.CropName = dataTable1.Rows[0]["Level2"].ToString();
                            break;
                        case 3:
                            crop.CropName = dataTable1.Rows[0]["Level3"].ToString();
                            break;
                        case 4:
                            crop.CropName = dataTable1.Rows[0]["Level4"].ToString();
                            break;
                        case 5:
                            crop.CropName = dataTable1.Rows[0]["Level5"].ToString();
                            break;
                        case 6:
                            crop.CropName = dataTable1.Rows[0]["Level6"].ToString();
                            break;
                        default:
                            break;
                    }
                }
                  
  
                  
                  int LocKey = Int32.Parse(dataTable.Rows[i]["DimGeographyKey"].ToString());
                string strSql2 = "select * from Dim_Geography where [Key]='" + LocKey + "'";
                SqlDataAdapter Da2 = new SqlDataAdapter(strSql2, Conn);
                DataTable dataTable2 = new DataTable();
                Da2.Fill(dataTable2);
                for (int k = 0; k < dataTable2.Rows.Count; k++)
                {
                    int temLocDepth = Int32.Parse(dataTable2.Rows[0]["Depth"].ToString());
                    switch (temLocDepth)
                    {
                        case 1:
                            crop.Location = dataTable2.Rows[0]["World"].ToString();
                            break;
                        case 2:
                            crop.Location = dataTable2.Rows[0]["Continent"].ToString();
                            break;
                        case 3:
                            crop.Location = dataTable2.Rows[0]["Nation"].ToString();
                            break;
                        case 4:
                            crop.Location = dataTable2.Rows[0]["Province"].ToString();
                            break;
                        case 5:
                            crop.Location = dataTable2.Rows[0]["City"].ToString();
                            break;
                        case 6:
                            crop.Location = dataTable2.Rows[0]["County"].ToString();
                            break;
                        default:
                            break;
                    }
                }
                  
                this.Add(crop);
            }
        }
    }
I successfully bind the demo data Cars  in a report and show the report in my Silverlight application, but when i bind my data Crops in a report, i can preview the data in the report, unluckily can't show in the Silverlight application, only throw the excetpion as i have described before.
Please help me!

Thanks!                                                                                                                                                                                                     
0
Steve
Telerik team
answered on 15 Sep 2010, 04:40 PM
Hi Yao,

Most of the demo reports that are part of the Visual Studio examples are bound to a database through our Data Source Components, and the ListBound report you refer to is the only one bound to a static class. Please use any of the other reports for testing. Additionally you have not provided details about the stack trace in Output window or what is the result when you try to access the .svc file directly in your browser - can you comment?

All the best,
Steve
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Equipe Info
Top achievements
Rank 1
answered on 16 Sep 2010, 10:22 AM
Hello,

I have the exact same exception in the reportviewer of my silverlight application. Nothing in the output window and nothing in the svc...
But why isn't there a method like RenderBegin, called RenderEnded ??? Therefore we will be able to catch the exception and debug our application !
Can the problem come from a large amount of pages generated or is there no limitation ?

Thanks,
Michael
0
Equipe Info
Top achievements
Rank 1
answered on 16 Sep 2010, 03:21 PM
I kept on testing the reportviewer with more data and here is where I came to :
With a report of 500 pages, the report shows in the ReportViewer.
With a report of 1000 pages, it doesn't show in the componant, and I have the same error as Yao Naiming does...
So, the page count of the report seems to be a limitation of the report viewer.
Also, IIS seems to overload on each refresh of the report. How can we deal with the usage of memory in the report ?
The main problem seems to be among this...

Sincerely,
Michael
0
Yao Naiming
Top achievements
Rank 1
answered on 17 Sep 2010, 03:21 AM
Hello,Steve
I have tried other reports in your demos, all of them perform very well in my Silverlight application. I also access the .svc file directly in my browser, it seems to work normally. You can see it as follow:
ReportService Service
  
  
You have created a service.
  
To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:
  
  
  
svcutil.exe http://localhost:27795/ReportService.svc?wsdl
  
This will generate a configuration file and a code file that contains the client class. Add the two files to your client application and use the generated client class to call the Service. For example:
  
  
C#
  
class Test
{
    static void Main()
    {
        ReportServiceClient client = new ReportServiceClient();
  
        // Use the 'client' variable to call operations on the service.
  
        // Always close the client.
        client.Close();
    }
}
  
  
  
Visual Basic
  
Class Test
    Shared Sub Main()
        Dim client As ReportServiceClient = New ReportServiceClient()
        ' Use the 'client' variable to call operations on the service.
  
        ' Always close the client.
        client.Close()
    End Sub
End Class
Thanks,
Yao
0
Yao Naiming
Top achievements
Rank 1
answered on 17 Sep 2010, 04:04 AM
Hello Equipe Info,
I think you are right. I have tried many times using different size of data, when the data is not large, it can be shown in the Silverlight application, or else the exception will be thrown.
Thanks,
Yao
0
Equipe Info
Top achievements
Rank 1
answered on 17 Sep 2010, 09:07 AM
Hello Yao Naiming,

I think the problem might come from 3 possible ways :
- The ReportViewer configuration to show page by page.
- The Reporting Service from Telerik that can't handle too many pages.
- IIS Configuration : maybe do you know if there is a parameter to increase cache for the Silverlight Application... (FYI, I'm testing in localhost).

Hope this helps !
Michael
0
Steve
Telerik team
answered on 21 Sep 2010, 04:11 PM
Hello guys,

Can you confirm that the problematic reports render ok in any of the other viewers e.g. web report viewer or windows forms viewer. If they do, then most likely the WCF service times out and you should increase the
corresponding bindings attributes e.g.

<bindings>
  <basicHttpBinding>
    <binding name="BasicHttpBindingConfig"
             maxReceivedMessageSize="10485760" maxBufferSize="10485760" maxBufferPoolSize="10485760"
             receiveTimeout="00:05:00" sendTimeout="00:05:00" openTimeout="00:05:00" closeTimeout="00:05:00"/>
  </basicHttpBinding>
</bindings>


Sincerely yours,
Steve
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Equipe Info
Top achievements
Rank 1
answered on 22 Sep 2010, 10:12 AM
Thanks for the help but it didn't worked...
I used your webconfig settings in the Csharp.ReportExamples.VS2008 using the SilverlightDemo, and I still get the same error...
If you could test it in a sample project it would be great ! Just populate a SQL Database table with enough rows to make 1000 pages and see if it works... If it does, the problem is on our side, if not, it's probably the Telerik Reporting Service...
Please give us a quick answer because we are already considering other solutions...

Many thanks,
Michael
0
Accepted
Steve
Telerik team
answered on 28 Sep 2010, 12:21 PM
Hi guys,

Find attached a sample Silverlight project that renders a 1220 pages reports into our Silverlight viewer. Review it and carefully and let us know if further help is needed.

Kind regards,
Steve
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Equipe Info
Top achievements
Rank 1
answered on 28 Sep 2010, 01:30 PM
Hello,

It seems to work better for the rendering maybe because you are using the IReportServiceClientFactory...
But still, when exporting the report to PDF, got the same error...
And why is the rendering taking so much time ? I have to say that I saw other reporting services going much more faster... Is it our configuration that is reponsible of this time or do you have the same thing on your side ?

Thanks,
Michael
0
Steve
Telerik team
answered on 04 Oct 2010, 03:15 PM
Hi Michael,

The problem is that the report service generates an output message that exceeds the maximum size quota I've specified (randomly inputted). To correct this I've specified int.MaxValue as value for the MaxBufferSize and the MaxReceivedMessageSize properties of the BasicHttpBinding object.
However the whole operation (rendering the report in the viewer and the export to PDF) now take around 15 minutes, so it is highly advisable that you filter your data to show less records based on certain criteria.

Greetings,
Steve
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Yao Naiming
Top achievements
Rank 1
answered on 05 Oct 2010, 02:37 PM
Hello Steve,
Thanks for your reply. I think you are right. Indeed, I should filter my data. But i think you need to consider this problem in the next version, perhaps someone need this kind of performance.
0
Steve
Telerik team
answered on 07 Oct 2010, 04:31 PM
Hi Yao Naiming,

I can assure you that we are constantly working towards better performance with each version, but we hope you appreciate that this is a complex product and refactoring code for performance purposes requires time and has to be done carefully in order to avoid breaking changes or introducing high number of bugs.
We believe this is normal having in mind that our reporting product is still very young and we are still catching up with other vendors features wise. Once all missing features are covered, we would be able to concentrate on performance.

Best wishes,
Steve
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Yao Naiming
Top achievements
Rank 1
Answers by
Steve
Telerik team
Yao Naiming
Top achievements
Rank 1
Equipe Info
Top achievements
Rank 1
Share this question
or