LightSwitch Reporting Preview

DevExpress Data Blog
13 June 2011

With our recent 11.1 release we have added support for Microsoft’s brand new development platform: Visual Studio LightSwitch. LightSwitch enables developers to quickly create business applications using preconfigured screens that adapt to the data you create. Unlike the Access databases of yore, the projects LightSwitch creates are written in .NET and adhere to standard practices when developing Silverlight applications. Additionally, LightSwitch allows for customer extensibility.

Here is where we come in.

DevExpress has partnered with Microsoft to bring you our award winning reporting solution within the context of LightSwitch. I will give you a quick tour using a pre-configured LightSwitch project. A little warning though: LightSwitch is still in Beta! Because of this little detail, our reporting extension will also be in beta up until there is an actual release of the LightSwtch platform. What I am showing here is indeed subject to change.

The screenshots posted here use the Course Manager application available over at MSDN.

The Extension

The first (and important step) is activating the extension. This is done by navigating over to the project properties and checking the appropriate extension.

LightSwitch Reporting Extensions

The Service

LightSwitch is actually creating a Silverlight application. Those familiar with our reporting suite know that in order to have a correctly functioning Silverlight report viewer one must add our Report Service. This is also the case for LightSwitch:

LightSwitch Report Service Data Source

The procedure to get this up and loaded is to add a new Data Source (by selecting a WCF RIA Service) and choosing the XtraReportService option.

LightSwitch Report Service

The Report

Once these two things are set up, its time to actually build the report! This is done by switching from Logical View over to File View

Is this the fifty?

and adding a new XtraReport to the Server project.

Adding the Report

Adding the Report

Once there, the first thing to do is to select the data to which the report will be bound.

LightSwitch Data Source

We have a special LightSwitchDataSource which allows the direct querying of the entities you define within LighSwitch. We never intended this implementation to be a hack of sorts that relied on extraneous data sources. We felt that a native LightSwitch experience that allowed the querying of in-project entities would provide the maximum benefit.

The nice thing about the entities designed within LightSwitch is that they also support the notion of master-detail type reports. Here is a screenshot of a report design in action:

LightSwitch Report Designer

This particular report is bound to the LightSwitch Student entity. As you can see, the enrollments link is preserved in order to allow for a master-detail type report.

The Code

One of the benefits of using LightSwitch is their notion of Screens. When editing Screens in LightSwitch the user has access to the Visual Tree. It is there that one can add buttons to trigger events. Once the button is added, the Execute Code can be edited. We have created a special method to render your reports once designed. Take a look:

LightSwitch Code

How simple is that!

The Result

Here is what the report looks like when everything is done:

Report Preview


Hopefully this little tour has answered some of your questions. I would like to reiterate, however, that this is still in beta. There are still a number of details that we need to polish up. The first question you might have is “how much will it cost?” A great question! This is one of those details we are still working out. Stay tuned for more information!

If you have any LightSwitch related questions, a great resource can be found over at MSDN: There you can find tons of downloads, samples, and training materials.

As always, if there are any comments and/or questions, feel free to get a hold of me!

Seth Juarez
Twitter: @SethJuarez

Want The Best Reporting Tool Ever?

Get The No-Compromise Reporting Tool for WinForms, ASP.NET, Silverlight and WPF! - Native integration with DevExpress WinForms and ASP.NET Controls, unequalled design-time productivity, industrial-grade features. Try a fully-functional version of DXperience for free now:

Let us know what you think of our Reporting Suite by rating it in the VS Gallery!

Follow SethJuarez on Twitter

FREE DevExpress Xamarin UI Controls

Deliver high-impact native mobile apps with our feature-rich Data Grid, Scheduler, Chart, TabView, Editors, and utility controls. Reserve your free copy today!
Rick Bartlett
Rick Bartlett

Great, you have created a tool for the departmental Excel guru's to play with.

Can we get back to the developer tools, hint Windows Phone

14 June 2011

Thank Set  I have only one question: how I can print a selected record that a student that not all

14 June 2011
Marcelo AR
Marcelo AR

Good to know DX is taking LightSwitch seriously. We expect all other DX controls to be adapated to LS as well.

14 June 2011

How can I make a report only for the selected item ?

16 June 2011
Maria obando 1
Maria obando 1

How to print an invoice ?

19 June 2011
Maria obando 1
Maria obando 1


20 June 2011
George (DevExpress)
George (DevExpress)


In LightSwitch, XtraReports supports all the features that are available for Windows Forms, and the process of creating any report is absolutely the same. To learn about specifics of LightSwitch reporting, please see the following tutorial:

21 June 2011
Maria obando 1
Maria obando 1

Thanks George , How can I make a report only for the selected item ?

22 June 2011
Maria obando 1
Maria obando 1

How can I make a report only for the selected item

27 June 2011
George (DevExpress)
George (DevExpress)

Maria, we are currently working on providing an example that demonstrates how this can be done. I will let you know! BTW, please do not hesitate to appeal to our Support Team (at with any question you have in order to receive immediate feedback.

13 July 2011
Visual Studio LightSwitch Team Blog

DevExpress has added LightSwitch support to their award winning reporting solution, XtraReports. This

20 July 2011
George (DevExpress)
George (DevExpress)

Hi Maria. We have updated our LightSwitch demos with our latest release. You can find a link to the new installation on the following page: Among other features the new demo should give you an idea of how you can accomplish your task. Please let me know whether or not this is helpful.

21 July 2011

Please login or register to post comments.