Building Data Rich Reports in a Snap (with Snap for WinForms)

DevExpress Data Blog
24 July 2013

Building top notch reports is hard; but not because building reports is a difficult task. The fact of the matter is that report building is often fraught with a set of miniscule tasks spread over a large amount of time. “Can you change the font….?” “I’m not sure that is the appropriate shade of red.” “How hard can it be to make a new report?”

With Snap for WinForms we can finally say “Sure! You do it.” We’ve recently even added two features that should make the process of offloading this task to your end users:

  1. Nested Fields
  2. Data Source Wizard

Nested Fields

One of the best UX design principles when it comes to managing data is the notion that we should only expose exactly what is necessary for the task at hand and allow the end user to drill in to more complex functionality as needed. This is especially true of the Field List. Often users are presented with something like this:

Long Field List

While not necessarily too cumbersome it is often useful to compartmentalize the data: in other words, create a hierarchy of fields such as this:

Nested Fields

It is important to note two things:

  1. The data is still flat (i.e. it isn’t a one-to-many relationship)
  2. This was accomplished by using a set of objects as the datasource

The first thing I did was create two classes:

public class Person
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public DateTime BirthDate { get; set; }
    public Contact Contact { get; set; }
}

public class Contact
{
    public string Address { get; set; }
    public string City { get; set; }
    public string Region { get; set; }
    public string PostalCode { get; set; }
    public string Country { get; set; }
    public string Phone { get; set; }
}

Note that there is a Nested Field (Contact) which contains additional information.

snapControl1.Document.DataSources.Add("Employees", Retrieve.Persons());

Finally I add an array of Persons (Person[]) as a DataSource. Done!

Data Source Wizard

One of the best features of our dashboard designer was the introduction of the powerful data source wizard. We’ve taken this powerful wizard and added it into Snap reporting:

Data Source Wizard

This will activate the same DataSource wizard available in our dashboard software:

Data Source Wizard Options

Running through the wizard will the provide the appropriate fields and allow your users to get up and running quickly with little to no developer intervention.

Snap Report

Summary

I would love your thoughts! We are making a strong push in our data analysis and presentation groups to simplify the interaction surface of our products in an effort to make it easier to produce more compelling data visualizations and reports. How are we doing?

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.