What's New in Spread.NET v18
Spread.NET v18 - December 5, 2024
Spread.NET v18 includes several great new features to introduce, including a new WPF version, improved PDF saving (with higher resolution), and more.
PDF Export
V18 of Spread WinForms and WPF now supports saving a spreadsheet document to much higher resolution PDF outputs with many of the same behaviors as Excel. This can be achieved in multiple ways:
- Saving a Sheet to PDF
sheet1.SaveAs("d:\\tmp\\Book1.pdf", GrapeCity.Spreadsheet.IO.FileFormat.PDF);
- Saving a Workbook to PDF
book1.SaveAs("d:\\tmp\\Book1.pdf", GrapeCity.Spreadsheet.IO.FileFormat.PDF);
- Printing a PDF
fpSpread1.Features.ExcelCompatiblePrinting = true;
fpSpread1.BorderCollapse = BorderCollapse.Enhanced;
The new PDF export supports Excel-compatible printing and now retains image quality. Some other printing enhancements include:
- RichText support
- Flat Style Mode format
- Image on header/footer
- Shapes with transparent colors
New WPF Spreadsheet Version
With the Spread.NET v18 release, we have introduced an entirely new and improved WPF version of our spreadsheet! This now allows us to continue to enhance the WPF control with many new features for future versions. Some new features introduced with this release include:
- Calculation Enhancements
- External References
- Iterative Calculation
- Asynchronous Functions
- Dynamic Arrays
- New Excel Functions
- Sparkline Functions
- External Variables
- Fields and Rich Value Structures
- New Chart Engine for more Excel Compatible Charts (Data Table, Trendline, etc.)
- Chart Color and Style
- Formula Textbox
- Exchangeable XLSX
- XML Data File Support
- Table Data Binding
- Sorting by colors, icons, etc.
- Removing duplicates
- Excel-like Fill (Gradient, Pattern, Theme Colors)
Copying Skip Invisible Ranges
When copying a range of cells, hidden cells can be excluded from the copy. The RichClipboard property must be set to true, as well as the CopySkipInvisibleRange property:
fpSpread1.Features.RichClipboard = true;
fpSpread1.AsWorkbook().Features.CopySkipInvisibleRange = true;
Table Auto Update Filter
Spread for WinForms now gives you the ability to change a table’s filter to be updated automatically after a user edits a cell or a data source is changed. This property can be set with the following code:
table.AutoFilter.AutoUpdate = false;
Context Menu without Ribbon Control
In previous releases of , the context menu could only be shown when the ribbon control was being used. With v18, the context menu can now be used without the Ribbon control by simply creating a new SpreadContextMenuStrip instance:
fpSpread1.ContextMenuStrip = new SpreadContextMenuStrip();
Copy Width/Height and Style when Inserting Rows and Columns
Inserting rows and columns into a WinForms spreadsheet now copies the row or column size and style from the previous row or column to the newly inserted one. This is supported via the context menu in both the Designer and at runtime, the ribbon bar, and using Ctrl+Shift+”+”.
Display and Execute Undo/Redo History
The Quick Access Toolbar in the Designer now supports an undo/redo actions history where the action can be executed again or undone. This is achieved by clicking on the Undo/Redo dropdown button in the Quick Access Toolbar:
Highlight Formulas
The DisplayFormulas property has been enhanced to highlight formulas for the active cell. Simply setting the property to true will enable this:
IWorksheet TestActiveSheet => fpSpread1.AsWorkbook().ActiveSheet;
private void Form1_Load(object sender, EventArgs e)
{
TestActiveSheet.View.DisplayFormulas = true;
TestActiveSheet.Cells["A1"].Value = 1;
TestActiveSheet.Cells["A2"].Formula = "A1";
TestActiveSheet.Cells["A2"].Select();
}
Get Cell Reference from Pointer Location
A new API has been added to get the cell at a specific x,y coordinate in pixels. This can be useful for laying out charts and shapes at specific cell coordinates or getting a cell reference from a specific point. For example, this code would return “B2” and “B21”:
fpSpread1.Height = (int)fpSpread1.ActiveSheet.Rows.Default.Height * 15;
RectangleShape s = new RectangleShape();
s.Size = new System.Drawing.Size(60, 60);
fpSpread1.ActiveSheet.AddShape(s, 1, 1);//B2
RectangleShape s1 = new RectangleShape();
s1.Size = new System.Drawing.Size(60, 60);
fpSpread1.ActiveSheet.AddShape(s1, 20, 1);//B21
Debug.WriteLine(fpSpread1.ActiveSheet.GetCellReference(s.Location.X, s.Location.Y).ToString());
Debug.WriteLine(fpSpread1.ActiveSheet.GetCellReference(s1.Location.X, s1.Location.Y).ToString());
To learn more, be sure to check out our demos and documentation.