How To: Telerik Reporting in Microsoft LightSwitch Beta 2

by Vladimir Enchev | Comments 28

Similar to my previous post, I've made small example to illustrate how to use Telerik Reporting in Microsoft LightSwitch Beta 2.

1) Create new LightSwitch project and add new screen:
 

 

 

 
2) Switch to File View, add references to the Silverlight assemblies in Client project, add new UserControl and declare an empty ReportViewer:

 

 

 
3) Add custom control in the screen designer and run the application to check the result:

 

* Don't forget to add references to the Telerik assemblies!
 

 
4) Add new WCF Service Application, add references to Telerik Reporting server-side assemblies from Reporting demos and declare the connection string and service configuration in Web.config (again from Telerik Reporting official examples):

 

 

* You will need AdventureWorks!
 

 
4) Copy ReportService.svc (again from Telerik Reporting official examples) in the WCF Service Application and declare the report and the service url in the ReportViewer:

 
5) Run the application and browse the Telerik Reporting demos from LightSwitch application:
 

Enjoy!

 

Download

,
Senior Technical Architect

28 Comments

Paul
Thanks Vladimir,

However I keep receiving and error: Element is already the child of another element. [Line: 0 Position: 0]

Any ideas?
Paul
Thanks Vladimir,

However I keep receiving and error: Element is already the child of another element. [Line: 0 Position: 0]

Any ideas?
flex
thanks , and that method apply to the tables from the creator of the ligtswtch 
Paul
Looks like the issue I was having before is because of the VB templates used for the LightSwitch projects. I'll have to escalate this with the LightSwitch team.

Cheers
Vlad
Hey Paul,

I've tried the same steps in VB and at least on my end everything worked as expected. Here is the VB version.

Vlad

PS: There is one additional step in VB - when you add the UserControl you need to declare the class in a namespace otherwise you will unable to add it later as custom control on the screen. 
Paul
Thanks Vlad,

Next question... how to bind locally.

Cheers :)
Bruce
So pretend I'm an end user trying to get this to work in my first LightSwitch application.  Will I be able to design reports using the LightSwitch Entity Sets concept and access the reports in a somewhat seamless fashion?  I do I have to be a pretty expert developer to get this to work?

I've mentioned before - getting Telerik reporting to work in a seamless fashion with LightSwitch would be a huge win.  Anything less and you'll just have a lot of frustrated people and it will be only be used by the few genius developers that are playing with LS for other reasons.

Vlad
Hi Paul, 

Local binding is not possible currently, as far as I know, since the reports are generated server-side and only previewed on the Silverlight client. I'll ask our Reporting team for more info.

Bruce,
I believe that our products are for developers not for end users :) and I don't believe that you need to be super genius developer to insert single line of XAML (since this is the only code I've wrote to build this). Nevertheless I'm sure that you will see many improvements in the future - in the meantime it is up to you and your current business needs to decide if you are going to use this approach or not.

Edison
I would like to not use wfc services Ria services if not send the normal report I did not use Ria services and which would be the steps
mary
report extencion 
Mark
Thanks Vladimir.

This was really helpful for getting a report viewer setup in my Lightswitch project.

Can you please update this post to show I can now point the report viewer to my own myReportLibrary?

Thanks for you help.
Vlad
Hi Mark,

You can specify your library using Report property of the ReportViewer.

Vlad
Paul
Hi Vlad,

Was there any response from your reporting team regarding the question on binding reports locally?
Vlad
Hi Paul,

Here is the response:

"As of now, our plans include client-side report authoring, while rendering reports on the Silverlight end is not in our current scope. "

Vlad
Vlad
Hey Paul,

Thanks for sharing!

Vlad
xg123
xg123
May
News extencion LS
Mcdistribution
reporting LS news 
John Marsing

Can you run your sample without having VS 2010 Pro?

I ran the sample and got this error….

An exception occurred during the operation, making the result invalid.  Check InnerException for exception details.

I realized I didn’t have AdventureWorks installed, so I did that, but I’m still getting the above errors.

Daniel
Hi,
I'm getting the following erro when I launch the application:
An exception occurred during the operation, making the result invalid.  Check InnerException for exception details.
this message appear in the middle of the report window.
Any idea?
Daniel
About my last message above, does it have anything to do with iis, because I don't have it.
Daniel
I further tried to make the example run, but still no idea on what is wrong.
What do I have to do with the WCFService project? Do I have to publish it?
Cliff McManus
Hey Guys
Could you please correct this sample.
I have been attempting to integrate a report viewer into a LS application for over a week and have had no success. There are examples out there but they all point back to this and we cannot get it to work. Your attention to this will be greatly appreciated.
Regards Cliff
Clement
Is this reporting tool usable with VS Lightswitch 2012
Heysol
'ReportViewer' does not exist in XML namespace 'clr-namespace:Telerik.ReportViewer.Silverlight;assembly=Telerik.ReportViewer.Silverlight'. I have this problem i did all what you say but i still have the same error I am using VS 2012 What should i do ?
Thanks

Comments

  1.    
      
      
       
  2. (optional, emails won't be shown on public pages)
  3. (optional)
Read more articles by Vladimir Enchev - or - read latest articles in Developer Tools


Follow vladimir_enchev on Twitter