Xenirio.Component.Gutenberg 1.7.0

dotnet add package Xenirio.Component.Gutenberg --version 1.7.0
                    
NuGet\Install-Package Xenirio.Component.Gutenberg -Version 1.7.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="Xenirio.Component.Gutenberg" Version="1.7.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Xenirio.Component.Gutenberg" Version="1.7.0" />
                    
Directory.Packages.props
<PackageReference Include="Xenirio.Component.Gutenberg" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Xenirio.Component.Gutenberg --version 1.7.0
                    
#r "nuget: Xenirio.Component.Gutenberg, 1.7.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.
#:package Xenirio.Component.Gutenberg@1.7.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Xenirio.Component.Gutenberg&version=1.7.0
                    
Install as a Cake Addin
#tool nuget:?package=Xenirio.Component.Gutenberg&version=1.7.0
                    
Install as a Cake Tool

Gutenberg

The .NET package report builder for generate Microsoft Word docuement with key-value replacement.

Concept

By inject values with the keys that represent in the MS Word document as a template, Gutenberg will generate the complete & beautiful WYSIWYG Word document for you.

Usage

  • To prepare MS Word template (.docx)

    1. Prepare the MS Word template with the format as you need.

    2. Declare {DOCVAR [variable name]} at places in the document that you need to replace with the value by the key is [variable name].

  • To inject the key-value into the document

    1. Declare ReportGenerator object with template file.

    var template = @"\resources\RecipeTemplate.docx";
    var report = new ReportGenerator(template);
    

    2. Set the key-value items with 2 options

    • 2.1. via Methods
      • report.setParagraph(string key, string value : Replace paragraph at {DOCVARIAVBLE key} with value
      • report.setParagraphs(string key, string[] values) : Replace list content (bullets/numbers/etc...) of paragraph at {DOCVARIAVBLE key} with values
      • report.setTableParagraph(string key, string[][] values) : Replace table content of paragraph at {DOCVARIAVBLE key} with values
    • 2.2. with JSON Data
      • Require package : Newtonsoft.Json version >=11.0.2
      • RecipeSource.json
        {
            "Content": {
                "Summary": {
                    "Author": "...",
                    "Serving": "..."
                },
                "Times": [
                    [ "...", ... ],
                    [ "...", ... ],
                    [ "...", ... ]
                ],
                "Recipe": {
                    "Name": "...",
                    "Description": "...",
                    "Filling": [...],
                    "Bakings": [...],
                    "Instructions": [...],
                    "Cooks": [...]
                }
            }
        }
        
      • C# Code
        var source = @"\resources\RecipeSource.json";
        var json = JObject.Parse(File.ReadAllText(source));
        report.setJsonObject(json);
        

    3. Produce docx report as output file

    var output = @"\RecipeSample.docx";
    report.GenerateToFile(output);
    
Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.7.0 962 12/30/2019

v1.6.5
     - Remove unused dependency
     v1.7.0
     - Introduce Expandable Table feature