Blogs

DevExpress Data Blog

This blog features all things having to do with data shaping, layout, and presentation!

LightSwitch Reporting Preview

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

Summary

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: http://msdn.com/LightSwitch. 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
Email: sethj@devexpress.com
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: http://www.devexpress.com/Downloads/NET/

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

Follow SethJuarez on Twitter

Published Jun 13 2011, 12:00 PM by
Bookmark and Share

Comments

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

June 14, 2011 11:05 AM

Edison

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

June 14, 2011 1:03 PM

Marcelo AR

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

June 14, 2011 3:47 PM

Edison

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

June 16, 2011 1:12 PM

Maria obando 1

How to print an invoice ?

June 19, 2011 12:49 PM

Maria obando 1

hi

June 20, 2011 12:30 PM

George (DevExpress)

Hi,

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: documentation.devexpress.com.

June 21, 2011 3:36 AM

Maria obando 1

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

June 22, 2011 4:10 PM

Maria obando 1

How can I make a report only for the selected item

June 27, 2011 1:28 PM

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 http://devexpress.com/sc) with any question you have in order to receive immediate feedback.

July 13, 2011 6:08 AM

Visual Studio LightSwitch Team Blog

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

July 20, 2011 4:01 PM

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: www.devexpress.com/.../LightSwitch. 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.

July 21, 2011 7:21 AM
LIVE CHAT

Chat is one of the many ways you can contact members of the DevExpress Team.
We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.

If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

FOLLOW US

DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

Copyright © 1998-2014 Developer Express Inc.
All trademarks or registered trademarks are property of their respective owners