What's new in GcExcel v2 Service Pack 1
Last year, we released Documents for Excel for both .NET and Java, offering APIs based on the Excel object model. GcExcel allows you to generate and work with spreadsheets with fast performance, a small footprint, and in .NET Standard 2.0 and Java applications. We are pleased to announce the new v2 service pack 1, which extends the feature set to support new features and improve on existing ones per our customers' requests.
Check out the new features below.
Add rich text to spreadsheet cells
GcExcel adds support for adding rich text to a cell, to achieve multiple styles on different parts of the text within a cell. You can set various font properties on the cell text through the API, and the rich text is supported during Excel I/O, JSON I/O and PDF exporting. You can create rich text and then configure the font for a range of text characters; or add, enumerate, operate and configure all text runs of the rich text.
.NET Demo | .NET Documentation | Java Demo | Java Documentation
Load, save, and preserve Excel files containing macros (I/O .xslm)
Now GcExcel can load and save .xlsm files that contain macros. The macros would not be executed, but are preserved when any operation is performed on the Excel file or during import/export of the Excel file.
var workbook = new GrapeCity.Documents.Excel.Workbook();
workbook.Open(this.CurrentDirectory + "macros.xlsm");
workbook.Save(this.CurrentDirectory + "macros-exported.xlsm");
.NET Demo | .NET Documentation | Java Demo | Java Documentation
Add background image to worksheet
With the support of background images, you can set company logos, watermarks, or any other worksheet data-related background image to the worksheet. Simply set one line of code:
//Set a background image for worksheet
worksheet.BackgroundPicture = File.ReadAllBytes(@"logon.png");
.NET Demo | .NET Documentation | Java Demo | Java Documentation
Support workbook styles
If you want to base the style of your workbook on an existing style, with some modifications, you can use the style, set additional settings to it, and save it as another style. The following overload helps you define a new style (string name), base it on existing style (IStyle baseOn - the style on which you want to base on), and then add it to the list of workbook styles:
workbook.Styles.Add(string name, IStyle baseOn)
.NET Demo | .NET Documentation | Java Demo | Java Documentation
Export Excel files containing vertical text to PDF
We already support Excel feature export to PDF, and with the new service pack, we improve the support of vertical text when exported to PDF. All settings on vertical text are preserved while exporting to PDF file.
.NET Demo | .NET Documentation | Java Demo | Java Documentation
Load and save JSON files with shapes
GcExcel can load and save any SpreadJS JSON files, and these files can be modified and saved back to JSON. GcExcel adds support of shapes while importing/exporting these JSON files.
.NET Demo | .NET Documentation | Java Demo | Java Documentation
Set JDK 8 datetime types to cell value in Documents for Excel, Java Edition
Java 8 introduced APIs that support many new date/time types and sub-packages to support JSR310 (Java Specification Requests for Date and Time API) in order to address some shortcomings of the older java.util.Date and java.util.Calendar. With the new service pack, GcExcel Java supports these new date/time types that you can use directly to set values in the Excel files. For example: LocalDate, LocalTime, LocalDateTime, Instant, MonthDay, OffsetDateTime, OffsetTime, Year, YearMonth ZonedDateTime, when working with Java 8 or higher.
Hope you like these new additions! For any feedback, please leave a comment below. Thanks!
For a list of bug fixes, visit the .NET Release Notes and Java Release Notes.