.NET Reporting: Data Access Enhancements (Coming soon in v14.2)

DevExpress Data Blog
24 November 2014

This is huge. I usually don’t start blog posts this way but something about our reporting suite nagged at me: I don’t like binding reports directly to database. In fact, I’ve always advocated a multi-tiered approach for accessing data – I’ve long said binding to an IEnumerable<T> was the way to go. While our reporting suite can certainly handle this scenario, it tended to be a bit kludgy. In fact, using the BindingSource in an ASP.NET application with XtraReports required taking a dependency on System.Windows.Forms (eww).

In our upcoming 14.2 release we swung for the fence when cleaning up this area and have hit a home run.

Object Binding Source

Since a picture is worth a thousand words, I thought I would take you through the process of creating an object bound report.

Bind to Object

After choosing an assembly you can choose the appropriate data type (still the same as before – kind of).

Select Object

Usually one would pick the Student class in this case given that it is that type to which we wish to bind. But since we’re swinging for the fence, I will choose the StudentService class.

Select Method

Yes, soak that previous screenshot in – we are binding to methods for this report. WAT?! How does it know what to bind to?? What will it pass in to the method??

The answer to the first question is not too hard: we look at the return type. The second question is not as easy.

Manage Method Parameters

Just kidding, it is easy. You can either specify a value, use an expression, or tell the report to use parameters (the kind already available in XtraReports).

Object Bound Report

All that can be said is this:

Yay!

Now reports can form part of your application in a natural way – not as an afterthought. All of the ingenuity you use to create service classes and overall application logic can now be easily leveraged across all of your reports.

Final Thoughts

I am really excited about the way we are both enlarging and yet simplifying the way you access, present, and analyze data.

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

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.