WinForms and WPF Spreadsheet: Mail-Merge, Comments, and more (Coming soon in v14.2)

ctodx
25 November 2014

In addition to the changes already described for the WinForms and the WPF spreadsheet controls, there are some smaller improvements and new features. Buckle up: this will be a wild ride…

Mail-Merge: Data Source Wizard (WinForms)

The Data Source Wizard allows the user to create a new data source, configure it, and, if there is more than one data source available, to select the one that is required for a particular task. Once created, the data source configuration will be stored in the XLS/XLSX spreadsheet file so the user does not have to re-configure the data source the next time.

WinForms Spreadsheet: Mail-Merge Data Wizard

In the past, creating and selecting such a data source required changes in your application code, so this user wizard should help reduce your involvement in such requirements, at least for technical users. With this wizard, the user can start performing a mail merge immediately the XLSX/XLS file is loaded into the Spreadsheet control.

Alongside this new feature, we’ve added the ability to manage queries:

WinForms Spreadsheet: Mail-Merge Query Designer

…and also provided the capability to define and manage the data relationships required for complex master-detail reports:

WinForms Spreadsheet: Data Relationship Editor

Mail-Merge: Parameters Panel (WinForms)

The Parameters Panel allows the user to fine-tune a mail-merge report by providing a required parameter. In previous versions, this relatively simple task required a significant amount of code. Here’s what it would look like for specifying an Order Number:

WinForms Spreadsheet: Mail-Merge Parameter Panel

To create a formula in the mail merge template linked to a certain parameter, the end-user can simply drag the parameter from the Parameters Panel and drop it onto a worksheet.

Along with this user-oriented improvement, there’s a corresponding addition to the mail-merge API: developers can now work with mail merge parameters in code by using the MailMergeParameters parameters collection.

Comments (WinForms and WPF)

With this release, you can attach additional informational text to individual cells by using comments. This feature is available to end-users:

WinForms/WPF Spreadsheet: Spreadsheet Comments

Comments are displayed in a floating box anchored to a cell. Users can add new comments, edit the text of existing comments, move and resize the comment box, and hide or completely delete comments if they are no longer required.

The feature is also available to developers: they can access worksheet comments in code using the CommentCollection collection. If required, developers can also restrict the use of Insert, Edit, Delete, Show/Hide, Move, and Resize operations for their users.

Document Properties (WinForms and WPF)

Next up are document properties. These form a set of information about the document (named values like Author, Keywords, etc, or custom properties) that is stored along with the document. Many document workflow systems require and depend on these properties.

Users can view and modify their document properties by using the built-in dialog. This is invoked by the Document Properties button in the Info group of the File tab.

WinForms/WPF Spreadsheet: Document Properties

Programmatically, developers can access document properties using the DocumentProperties interface (use the IWorkbook.DocumentProperties property) and the DocumentCustomProperties interface (use the DocumentProperties.Custom property). The following code snippet illustrates how to specify document properties.

      IWorkbook workbook = spreadsheetControl1.Document;
      workbook.DocumentProperties.Title = "Spreadsheet API: Document Properties Sample";
      workbook.DocumentProperties.Description = "Managing document properties using Spreadsheet API.";
      workbook.DocumentProperties.Author = "Gerald A. Gilbert";
      workbook.DocumentProperties.Custom["Checked by"] = "Mike Hamilton";     

The screenshot above is from our demo app. It illustrates the use of a custom worksheet function (UDF, or user-defined function, using Excel terminology) to display the values of the document properties in worksheet cells. (Please note that this function, DOCPROP, was written specially for this app. It’s not part of the standard spreadsheet control.)

New Spreadsheet Functions (WinForms, WPF, Spreadsheet Document Server)

As with every release, we add to the list of supported spreadsheet functions. This time we’ve added several to help with statistical analysis, especially trend analysis. With these new functions (LINEST, LOGEST, TREND, GROWTH, and FORECAST), we can perform a linear or exponential trend analysis:

WinForms/WPF Spreadsheet: Exponential Trend Analysis

We’ve also added the following functions (please see the Excel documentation for descriptions and usage details for now):

  • Statistical: BINOM.DIST, BINOM.INV, POISSON.DIST, EXPON.DIST, NEGBINOM.DIST, WEIBULL.DIST, HYPGEOM.DIST, CONFIDENCE.T, PERMUT, PROB, RSQ, STEYX, TRIMMEAN, VARA, VARPA, Z.TEST, GAUSS
  • Math: CEILING.PRECISE, FACTDOUBLE, FLOOR.PRECISE, GCD, LCM, MULTINOMIAL, ROMAN, SERIESSUM
  • Financial: ACCRINTM, COUPDAYBS, COUPNCD, COUPNUM, COUPPCD, DDB, DISC, FVSCHEDULE, INTRATE, ISPMT, PRICEDISC, RECEIVED, SLN, SYD, TBILLEQ, TBILLPRICE, TBILLYIELD, VDB, YIELDDISC
  • Text: BAHTTEXT
  • Compatibility: BINOMDIST, POISSON, EXPONDIST, NEGBINOMDIST, WEIBULL, HYPGEOMDIST, CRITBINOM, ZTEST

Support for Complex Ranges (WinForms / WPF / Spreadsheet Document Server)

With v14.2, the spreadsheet API includes support for disjoint ranges; no longer do you have to just work with a continuous range of cells. This enhancement allows operating with collections of ranges, comprising several discontinuous or even intersecting ranges. The Range.Union method creates a complex range which can be used in the same manner as an ordinary range.

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.