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

create a report in Silverlight

3 Answers 85 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bernard
Top achievements
Rank 1
Bernard asked on 05 Dec 2011, 04:07 PM
Hello,

In my silverlight application, I have two projects:
GestionJ and GestionJ.Web

In my Home.xaml page of GestionJ, I have a ReportViewer which comes from the toolbox "Telerik Reporting Q3 2011".

For the moment, in design view  it indicates "No report".

The code is:

<my:ReportViewer Name="reportViewer1" Height="220" />



In GestionJ.Web, I have had one file named "ReportService.svc" which contains only one line:

<%

 

@ServiceHost Service="Telerik.Reporting.Service.ReportService, Telerik.Reporting.Service, Version=5.3.11.1116, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE" %>


5.3.11.1116 is the version of Telerik.Reporting.Service.dll in references of GestionJ, I hope this is correct...

In GestionJ.Web, I have added a new Item (a Telerik Report Q3 2011) named ClientsRPT.cs.

I have followed the Wizzard and if I open ClientsRPT.cs[Design] I see all needed fields, and if I click "Preview" or "Html Preview", I see the report with the right data.

My question is how can I link this report  ClientsRPT from GestionJ.Web with the ReportViewer in GestionJ ?





3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 08 Dec 2011, 03:43 PM
Hello Bernard,

The ReportViewer.Report property expected the assembly qualified name of the Report type for the viewer to display i.e. you should make sure that it is correct in order to display the report inside the viewer.
Generally if you follow our best practices and add the reports to a separate class library, you would have to copy the connectionString from the app.config of the class library to the web application web.config file. However you state that you've added the report directly to the web application, which means the connectionString would be in the web.config should you use our Data Source Components. If not, please elaborate how you bind you report.

Kind regards,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
ROB
Top achievements
Rank 1
answered on 06 Jan 2012, 07:06 AM
I am having the same problem, I have a Silverlight applicaiton with two projects; WFD and WFD.Web using RIA services talking to Entity Framework.  I have tried to add the Silverlight report viewer to the WFD sl application (which works fine).  I have followed the steps in your online help to get it all setup correctly. 

1. I created the ReportService.svc file and copied the service defination into it, making sure to get the version right.  I put the file in the root of the .Web project.

2. I made the additions to the web.config to add the ReportService services and endpoints.

3. I set the Report property to the qualified name of the report.  The report exist in the .Web project.  I do this so that I can have the ability to use the Entity and a data source.

4. I set the ReportServiceUri property to ../ReportService.svc

I'm not sure what else there is do to, the documentation on this is very lacking.

At any rate, once I run the app and go to the viewer page, I get nothing but "no report".  It gives me no feedback so I have no idea what to look into to try to fix it.

It seems pretty simple but in googling and browsing it seems that no one knows how to do this.

Thanks for your help,
Steve Hatch

0
Steve
Telerik team
answered on 11 Jan 2012, 09:29 AM
Hello Rob,

According to your description, it would seem that the report assembly is not loaded into your AppDomain. The IReportService.ListAvailableReports() method uses reflection to find all available reports - that is, all loaded into the current AppDomain types that implement the Telerik.Reporting.IReportDocument interface.
So you must have the assemblies that contain your reports loaded into the current AppDomain. This means that not only your report libraries should be referenced, but you have to use them.

The solution is as simple as referencing a single type from the report library like this:
Copy Code
public class Global : System.Web.HttpApplication
{
    ....
     
    protected void Application_Start(object sender, EventArgs e)
    {
        var t = typeof(MyReportLibrary.Report1);
    }
 
    ....
}

The code snippet above relies on the Application_Start method in Global.asax and its only purpose is to force the .NET runtime to load the assembly where MyReportLibrary.Report1 type resides.

All the best,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

Tags
General Discussions
Asked by
Bernard
Top achievements
Rank 1
Answers by
Steve
Telerik team
ROB
Top achievements
Rank 1
Share this question
or