RaisExcelExport 1.4.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package RaisExcelExport --version 1.4.0
NuGet\Install-Package RaisExcelExport -Version 1.4.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RaisExcelExport" Version="1.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RaisExcelExport --version 1.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: RaisExcelExport, 1.4.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install RaisExcelExport as a Cake Addin #addin nuget:?package=RaisExcelExport&version=1.4.0 // Install RaisExcelExport as a Cake Tool #tool nuget:?package=RaisExcelExport&version=1.4.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
RaisExcelExport
Create excel export as memory stream or physical file.
New Features!
- Excel export in memorystream.
- Save export to disk in .xlsx format.
- HeaderRow background and foreground color.
using Rais;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Demo
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
List<Object> Employees = new List<object>();
for (int i = 1; i <= 10; i++)
{
Employees.Add(new Employee { SrNo = i, Name = null, JoiningDate = DateTime.Now.AddDays(i), Hike = 12.34 + i, Score = (i) - 100 });
}
RaisExcelExport exportObject = new RaisExcelExport();
/* Use this link to convert RGB to Hex color : https://www.w3schools.com/colors/colors_rgb.asp */
exportObject.DateFormat = "[$-409]d\\-mmm\\-yy;@";
exportObject.HeaderBackgroundColorHex = "808080";
exportObject.HeaderForeGround = "ffffff";
exportObject.Columns.Add(new ExcelColumn() { BindToProperty = "SrNo", DataType = ExcelColumnDataType.Integer, HeaderText = "Sr. No.", Width = 20 });
exportObject.Columns.Add(new ExcelColumn() { BindToProperty = "Name", DataType = ExcelColumnDataType.Text, HeaderText = "Employee Name", Width = 50 });
exportObject.Columns.Add(new ExcelColumn() { BindToProperty = "JoiningDate", DataType = ExcelColumnDataType.Date, HeaderText = "Joining Date", Width = 15 });
exportObject.Columns.Add(new ExcelColumn() { BindToProperty = "Hike", DataType = ExcelColumnDataType.Double, HeaderText = "Hike", Width = 10 });
exportObject.Columns.Add(new ExcelColumn() { BindToProperty = "Score", DataType = ExcelColumnDataType.IntegerNegative, HeaderText = "Score", Width = 10 });
exportObject.ExportList = Employees;
exportObject.SheetName = "Employee List";
/* Save to disk */
exportObject.CreateExcelExport(@"c:\temp\EmployeeExport.xlsx");
MemoryStream memoryStream = exportObject.CreateReportAsMemoryStream();
System.Diagnostics.Process.Start(@"c:\temp\EmployeeExport.xlsx");
}
}
public class Employee
{
public int SrNo { get; set; }
public string Name { get; set; }
public DateTime JoiningDate { get; set; }
public double Score { get; set; }
public double Hike { get; set; }
}
}
License
MIT
Free Library
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
- DocumentFormat.OpenXml (>= 2.8.1)
- Microsoft.NETCore.Platforms (>= 2.2.0)
- NETStandard.Library (>= 2.0.3)
- System.Console (>= 4.3.1)
- System.Diagnostics.DiagnosticSource (>= 4.5.1)
- System.IO.Packaging (>= 4.5.0)
- System.Net.Http (>= 4.3.4)
- System.Security.Cryptography.Algorithms (>= 4.3.1)
- System.Security.Cryptography.X509Certificates (>= 4.3.2)
- System.Xml.ReaderWriter (>= 4.3.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Added Background and Foreground for header row.