WordReporter.NPOI
0.1.2
dotnet add package WordReporter.NPOI --version 0.1.2
NuGet\Install-Package WordReporter.NPOI -Version 0.1.2
<PackageReference Include="WordReporter.NPOI" Version="0.1.2" />
<PackageVersion Include="WordReporter.NPOI" Version="0.1.2" />
<PackageReference Include="WordReporter.NPOI" />
paket add WordReporter.NPOI --version 0.1.2
#r "nuget: WordReporter.NPOI, 0.1.2"
#:package WordReporter.NPOI@0.1.2
#addin nuget:?package=WordReporter.NPOI&version=0.1.2
#tool nuget:?package=WordReporter.NPOI&version=0.1.2
Description
The WordReporter.NPOI NuGet package provides an easy way to generate Word documents based on templates using the NPOI library. It allows you to quickly and effortlessly fill templates with data and save them in .docx format.
Installation
You can install the package via the NuGet Package Manager by running the following command:
Install-Package WordReporter.NPOI
Or using the .NET CLI:
dotnet add package WordReporter.NPOI
Usage
Code Example
Here’s an example of how to use the package to generate a Word document based on a template:
// Path to the template and resulting file
string templatePath = "path_to_template.docx";
string resultPath = "path_to_result.docx";
// Data to be filled into the template
var data = new
{
// Your data
};
// Create an instance of XWPFTemplate with the specified template
var template = new XWPFTemplate(templatePath);
// Generate the document using the provided data
template.Generate(data);
// Save the generated document to a file
using var t = new FileStream(resultPath, FileMode.Create, FileAccess.Write);
template.SaveAs(t);
Parameter Descriptions
templatePath: The path to the template file, which should be in.docxformat.resultPath: The path to the file where the generated document will be saved.data: An object containing the data to fill the template. Ensure that the fields of the object correspond to the placeholders in the template.
Dependencies
- .NET 8.0.
- NPOI
License
This project is licensed under the Apache License, Version 2.0. You can find the full license text in the LICENSE file.
Additional Information
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.