GrapeCity.ActiveReports.SpreadBuilder
Excel API library for BIFF7 (Windows only), BIFF8 and OpenXML formats.
Install
| Product | Versions |
|---|---|
| .NET Standard | |
| Other |
README
Introduction
ActiveReports is a unique collection of developer reporting tools that help consume, process, and visualize data in the form of compelling and easy-to-understand reports.
ActiveReports provides a lot of features for developers and end-users, like:
- VisualStudio integration support.
- PaaS support (like Azure Linux App Service).
- Different possibilities to pivot and aggregate data.
- Rich data visualization.
- Popular export formats (like PDF/Excel/Word).
- And a lot more (https://www.grapecity.com/activereportsnet).
Concept
This package includes the .NET and .NET Core assemblies for reading, manipulating and writing Excel files. So you can create Excel spreadsheets cell by cell.
Example:
// Create a Workbook and add a sheet to its Sheets collection
System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(1, 1);
System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bitmap);
GrapeCity.SpreadBuilder.Workbook sb = new GrapeCity.SpreadBuilder.Workbook((text, measurementParams) =>
{
// required for auto-row height function only
System.Drawing.FontStyle style = System.Drawing.FontStyle.Regular;
if (measurementParams.FontBold) style |= System.Drawing.FontStyle.Bold;
if (measurementParams.FontItalic) style |= System.Drawing.FontStyle.Italic;
using (System.Drawing.Font gFont = new System.Drawing.Font(measurementParams.FontName, measurementParams.FontSize, style))
{
int maxWidth = (int)System.Math.Ceiling(measurementParams.MaxWidth);
System.Drawing.SizeF size = graphics.MeasureString(text, gFont, maxWidth == 0 ? 999999 : maxWidth);
return new System.Drawing.SizeF((float)System.Math.Ceiling(size.Width), (float)System.Math.Ceiling(size.Height));
}
});
sb.Sheets.AddNew();
// Set up properties and values for columns, rows and cells as desired
sb.Sheets[0].Name = "Customer Call List";
sb.Sheets[0].Columns(0).Width = 2 * 1440;
sb.Sheets[0].Columns(1).Width = 1440;
sb.Sheets[0].Columns(2).Width = 1440;
sb.Sheets[0].Rows(0).Height = 1440 / 4;
// Header row
sb.Sheets[0].Cell(0,0).SetValue("Company Name");
sb.Sheets[0].Cell(0,0).FontBold = true;
sb.Sheets[0].Cell(0,1).SetValue("Contact Name");
sb.Sheets[0].Cell(0,1).FontBold = true;
sb.Sheets[0].Cell(0,2).SetValue("Phone");
sb.Sheets[0].Cell(0,2).FontBold = true;
// First row of data
sb.Sheets[0].Cell(1,0).SetValue("GrapeCity");
sb.Sheets[0].Cell(1,1).SetValue("Mortimer");
sb.Sheets[0].Cell(1,2).SetValue("(425) 880-2601");
// Save the Workbook to an Excel file
sb.Save("test.xls");
See also
- GrapeCity.ActiveReports.Viewer.Win
- GrapeCity.ActiveReports.Viewer.Wpf
- GrapeCity.ActiveReports.Web
- GrapeCity.ActiveReports.Aspnetcore.Viewer
- GrapeCity.ActiveReports.Blazor.Viewer
- GrapeCity.ActiveReports.Design.Win
- GrapeCity.ActiveReports.Aspnetcore.Designer
- GrapeCity.ActiveReports.Export.Pdf
IMPORTANT
This package will be discontinued in the next major release. It is highly recommended that you update to the newer version of the package to ensure continuity and receive the latest features and security updates.
For the US version of ActiveReports: Update here: New Package Version
For the CN version of ActiveReports: Update here: New Package Version
To facilitate this transition, we've provided a Migration Tool to automatically update the references in your .NET project.
Changes from Previous Version
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.