Spreadsheet Mail Merge (Coming soon in v14.1)

At DevExpress we are committed to innovation when it comes to working with and presenting data. Our reporting suite is second to none when it comes to pixel-perfect reporting. Snap was designed to bring mail-merge to the next level: flow based reporting. I am pleased to announce that in our upcoming release we will continue this type of innovation by adding a mail-merge feature to our Windows Spreadsheet control

Setup

Included in the spreadsheet smart tag is the “Create Mail Merge Bars” link.

Spreadsheet Tasks

This action will add the necessary ribbon items to manage the mail merge functionality in the spreadsheet. Additionally, clicking on the “Create Field List Panel” will add the UI necessary for dragging and dropping fields from the data source.

Mail Merge Tools

The two important properties for filling the Field List are “MailMergeDataSource” and “MailMergeDataMember.”

var connection = new SqlConnection(CONNECTION);
var adapter = new SqlDataAdapter("SELECT * FROM Products", connection);
var productsTable = new DataTable("Products");
adapter.Fill(productsTable);
spreadsheetControl1.Document.MailMergeDataSource = productsTable;
spreadsheetControl1.Document.MailMergeDataMember = "Products";

The last two lines are the important bit really: it effectively sets the DataSource and DataMember of the underlying spreadsheet.

Usage

You can add a Detail, Header, and Footer section to the document. Clicking on the “Mail Merge Design View” button will display each of the three regions that have been designated as the “bindable” sections. You can then either drag the fields into the corresponding sections or type them is as formulas.

Formulas

One of the neatest parts is the fact that these fields can also participate in excel functions. That even includes aggregate functions in the Header or Footer sections.

Aggregate Formulas

When clicking on the preview you get exactly what you would expect:

Preview

The aggregate also expands into a sensible excel formula:

Aggregate Preview

Given that this is a spreadsheet we also added the option of the detail repetition happening vertically (as shown above) or horizontally.

Orientation

Conclusion

When it comes to showing data we have the greatest range of flexibility in terms of controls and approaches. I am looking forward to seeing what you create with this!

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

12 comment(s)
Steven Rasmussen

This looks great!  Does the Field list allow for child objects and their properties as well?

I'm guessing that multiple data sources are also allowed?

Can you have multiple "Detail" sections so that if you had 2 data sources then each could have their own detail section?

29 May, 2014
Alexander Krakhotko (Xafari team)

excel reports - the most anticipated for users.

because it is the native business-reporting

can I get an example of horizontal loops repetition?

in one report, the use of several directions repetition:

1) for the first level of the group, vertical extension;

2) for second-level group, the horizontal expansion?

30 May, 2014
Axel Z (DevExpress)

Steven.

Yes, the Field List panel can display child objects and their fields if you bind the spreadsheet to a hierarchical data source.

Currently, a template can be bound to a single data source, but the data source can contain multiple tables and relations. If you use the Master-detail scenario, you can create multiple nested detail levels (DetailLevel ranges) in parent detail range and assign different child data members to them.

For example, see our "XtraSpredsheet Main Demo - Master Detail Reports" demo module.

30 May, 2014
Axel Z (DevExpress)

Alexander,

Our XtraSpreadsheet 14.1 Main Demo - Merge Images demo module demonstrates how the horizontal document orientation can be used.

Currently, different document orientations can't be applied to groups and detail levels.

30 May, 2014
Nate Laff

Holy moly, that's pretty cool. Didn't realize this was in 14.1.

30 May, 2014
Axel Z (DevExpress)

Nate.

The mail merge functionality has been implemented in 13.2.

In 14.1, we improved this and added grouping, filtering and some visualization improvements.

30 May, 2014
Nate Laff

Yeah I use mail merge in Snap currently, which I had been dying for. But this is new to spreadsheet, right?

30 May, 2014
Axel Z (DevExpress)

Nate,

Yes.

30 May, 2014
郑 天生

没见到有这个功能啊

4 June, 2014
Axel Z (DevExpress)

Zheng,

See our XtraSpreadsheet demos (the Mail Merge section).

4 June, 2014
郑 天生

Axel Z (DevExpress)

wpf不支持这个功能么?

20 June, 2014
Axel Z (DevExpress)

Zheng,

Now we don't support mail merging in the WPF spreadsheet control, but we plan to realize this functionality in 14.2.

23 June, 2014

Please login or register to post comments.