BroggiSoft.OfficeExport
1.6.0
Prefix Reserved
dotnet add package BroggiSoft.OfficeExport --version 1.6.0
NuGet\Install-Package BroggiSoft.OfficeExport -Version 1.6.0
<PackageReference Include="BroggiSoft.OfficeExport" Version="1.6.0" />
paket add BroggiSoft.OfficeExport --version 1.6.0
#r "nuget: BroggiSoft.OfficeExport, 1.6.0"
// Install BroggiSoft.OfficeExport as a Cake Addin
#addin nuget:?package=BroggiSoft.OfficeExport&version=1.6.0
// Install BroggiSoft.OfficeExport as a Cake Tool
#tool nuget:?package=BroggiSoft.OfficeExport&version=1.6.0
BroggiSoft.OfficeExport
Generate documents with the BroggiSoft.OfficeExport package. Simply use the tag system to transform your templates into final Word, Excel or PowerPoint documents. The package will retain the font, size, and other formatting, and can generate rows in a table if the object is an array, or replace an existing rectangle shape with your image (your logo for example). Leave the management of documents (contracts, letters, etc.) to the business users, while developers only need to supply the data model in the form of a dictionary, JSON, or object to seamlessly populate your Word, Excel, or PowerPoint documents.
Features
- Replace simple text tags in Word, Excel and PowerPoint templates with JSON, dictionary or object types.
- Support for arrays, you can send an array of objects, of string, of int... and it will add as many rows in a Word, Excel or PowerPoint table.
- Support for images, you can add an image from a base64 format.
How to use
- Create a template (Word, Excel or PowerPoint) with tags, for example {{city}}
- Create a JSON, dictionary or object with the corresponding values
- Use BroggiSoft.OfficeExport to replace the tags with the values and generate the final document
- For an array, create a table in your template et set a tag in a row like {{YourArray[i].YourProperty}} or {{YourArray[2].YourProperty}} for a specific position. This will add as many rows as there are in the array. {{Product[i].Price}} : for each product a row will be added in the table and set the value Price of this product.
- For add an image, insert a rectangle shape with the excpected size int your template, and set in this shape a text tag {{IMG=YourNameTag}}, the value of your image must be in base64 format.
Examples
string jsonValues = "{\"name\":\"John\",\"city\":\"New York\"}";
OfficeExport.ExportFromJson("WordTemplate.docx", "WordResult.docx", jsonValues);
//Or with an object:
ExampleModel example = new ExampleModel();
example.value1 = "Hello";
example.value2 = "World";
OfficeExport.ExportFromObject("WordTemplate.docx", "WordResult.docx", example);
Use
This tool is completely free. All the necessary documentation can be found at: https://www.broggisoft.com/wiki
Terms and conditions can be found here: https://www.broggisoft.com/termsandconditions
If you have any questions, please don't hesitate to contact me at contact@broggisoft.com.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
.NET Core | netcoreapp3.1 is compatible. |
.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. |
-
.NETCoreApp 3.1
- DocumentFormat.OpenXml (>= 2.15.0)
-
.NETFramework 4.6.1
- DocumentFormat.OpenXml (>= 2.15.0)
- System.Text.Json (>= 6.0.6)
-
net5.0
- DocumentFormat.OpenXml (>= 2.15.0)
-
net6.0
- DocumentFormat.OpenXml (>= 2.15.0)
-
net7.0
- DocumentFormat.OpenXml (>= 2.15.0)
-
net8.0
- DocumentFormat.OpenXml (>= 2.15.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.