How To: Telerik Reporting in Microsoft LightSwitch Beta 2

Tuesday, April 12, 2011 by Vladimir Enchev | Comments 25

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

25 Comments

  • Paul 12 Apr 2011
    Thanks Vladimir,

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

    Any ideas?
  • Paul 12 Apr 2011
    Thanks Vladimir,

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

    Any ideas?
  • flex 12 Apr 2011
    thanks , and that method apply to the tables from the creator of the ligtswtch 
  • Paul 12 Apr 2011
    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 13 Apr 2011
    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 13 Apr 2011
    Thanks again Vlad.

    I eventually figured out the work around. (see this thread on msdn http://social.msdn.microsoft.com/Forums/en-US/lightswitchgeneral/thread/40cec0eb-2f68-4243-af6e-377bf4274f53)

    Now to try and get LightSwitch data into the report.

    Cheers!
  • Paul 13 Apr 2011
    Thanks Vlad,

    Next question... how to bind locally.

    Cheers :)
  • Bruce 13 Apr 2011
    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 14 Apr 2011
    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 15 Apr 2011
    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 19 Apr 2011
    report extencion 
  • Mark 03 May 2011
    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 04 May 2011
    Hi Mark,

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

    Vlad
  • Paul 09 May 2011
    Hi Vlad,

    Was there any response from your reporting team regarding the question on binding reports locally?
  • Vlad 10 May 2011
    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
  • Paul 15 May 2011
    Hi gang,

    Here is a post of how I used the Telerik Report Viewer in a LightSwitch (beta 2) application. 

    http://www.paulspatterson.com/technology/lightswitch/microsoft-lightswitch-using-a-telerik-report-viewer/

    Hope this helps.

    Cheers. 
  • Vlad 16 May 2011
    Hey Paul,

    Thanks for sharing!

    Vlad
  • Paul Patterson 02 Jun 2011
    FYI...

    http://www.devexpress.com/Subscriptions/DXperience/WhatsNew2011v1/index.xml?page=2

    Seems a competitor may beat Telerik to market with this...
  • xg123 08 Jun 2011
    xg123
  • May 14 Jun 2011
    News extencion LS
  • Mcdistribution 24 Jun 2011
    reporting LS news 
  • John Marsing 25 Aug 2011

    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 05 Oct 2011
    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 05 Oct 2011
    About my last message above, does it have anything to do with iis, because I don't have it.
  • Daniel 05 Oct 2011
    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?

Add comment

  1. Formatting options
       
     
     
     
     
       
  2. (optional, emails won't be shown on public pages)
  3. (optional)