Filtering Report Data using LightSwitch Query Parameters

DevExpress Data Blog
15 July 2011

In the next minor release (v2011 vol 1.6), XtraReports will provide the capability to filter your report's data on the server-side by utilizing LightSwitch queries. This blog demonstrates this functionality.

After adding a query to your application…

Adding LightSwitch Query

…you can define a parameter to be used in its filtering criterion, …

LightSwitch queries in XtraReports

Now all you need to do is bind to the query in the report

Binding XtraReport to LightSwitch Query

... and the rest is taken care of automatically.

Passing parameters to LightSwitch reports

Once the application is run, the Parameters panel of the report's Print Preview will be enabled so that you can pass values to the query parameter which then re-creates the report document.

Passing parameters to XtraReports in LightSwitch

Please feel free to leave your comments below.

 

Showcase Your Apps on DevExpress.com

Highlight your business app and share your development experiences with the DevExpress community. To include your app in our upcoming App Showcase, please forward an application screenshot to clientservices@devexpress.com and tell us which DevExpress products you currently use within your organization.
11 comment(s)
Richard Choroszewski
Richard Choroszewski

Interesting.

Any suggestions how the parameter could be set up as a drop down for example to provide a list of countries?

17 July 2011
George (DevExpress)
George (DevExpress)

Hi Richard. Thank you for your interest in our product! As for your question, we addressed this functionality in our new LightSwitch demos that will be shipped with our next minor version (v2011 vol 1.6), which we expect to release later this week.

18 July 2011
Anonymous
DevExpress Reporting Blog

In this blog post I will explain another small feature of XtraReports for LightSwitch: the ability to

20 July 2011
Anonymous
Visual Studio LightSwitch Team Blog

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

20 July 2011
Martin Cotter
Martin Cotter

Thanks guys a really good improvement.

One thing though ,after installing the update I am now getting a reportpreview does not exist error :(

21 July 2011
George (DevExpress)
George (DevExpress)

Hello Martin. This error may appear because we have changed the approach of showing report preview in LightSwitch. The new approach is explained at community.devexpress.com/.../lightswitch-reporting-showing-your-reports-in-a-separate-screen.aspx. Please let me know whether or not this is helpful.

21 July 2011
colman wells
colman wells

I like the seperate screen approach.Now how do i call and pass the parameter from another screen programmatically instead of data entry on the report screen.

25 July 2011
George (DevExpress)
George (DevExpress)

Hello Colman. The following thread demonstrates an idea of how you can solve this task: community.devexpress.com/.../351109.aspx. Please try this solution and let me know whether or not it is helpful.

8 August 2011
Ben Lam
Ben Lam

Hi George, I want t offer a drop down for parameters as Richard suggested. Where can I find the demo/source code/example you referred to in your July 18, 2011 10:05 AM post? Thanks!

14 October 2011
nico nico
nico nico

hi !

how can i use a guid to filter the data^

thank you

5 April 2012
Heather Mounts
Heather Mounts

This is great!  Is there a way I can multilple parameters?

thank you!

28 November 2012

Please login or register to post comments.