• Stars
    star
    125
  • Rank 284,857 (Top 6 %)
  • Language
    C#
  • License
    MIT License
  • Created over 13 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A WYSIWYG document template engine to generates .odt/.ods/docx/xlsx/doc/xls documents for .NET

MaltReport

NuGet Stats Build status Build Status

PLEASE NOTE:

  • At this very moment I'm rewriting the old library, the next coming v3.0 will be an incompatible version;
  • I'm also working on a additional commerce library for the docx/xlsx support, closed-source library for MS-Office seems fair;
  • The super old and buggy OfficeML support will be dropped, the OfficeML format is a legacy from 2003;
  • More real world unit tests, more documents;
  • Check dev branch to track the progress of the incoming v3 series.

MaltReport is an OpenDocument/OfficeOpenXML powered document template engine for .NET and Mono, it is inspired by the excellent Relatorio Project.

There is a briefly introduction in Chinese: MaltReport2 中文使用简介

MaltReport DO NOT REQUIRES MS-Office or LibreOffice to generate document. Instead MaltReport manipulates ODT/ODS/XLS/DOC file by itself, so it could be fast & reliable.

Documents

Getting Started

Prerequisites

  • Visual Studio 2017: This project is written in C# 7.0 using Microsoft Visual Studio 2017 Community Edition.

Supported Platform

  • .NET Framework 4.6.1
  • .NET Standard 1.6+

Installation

MaltReport can be installed from NuGet.

Demo & Usage:

Step 1: Organize your data into Context

var employees = new Employee[]
{
    new Employee{ Name = "Micheal Scott", JobTitle = "Branch Manager" },
    new Employee{ Name = "Pam Beesly", JobTitle = "Office Administrator" },
    new Employee{ Name = "Jim Halpert", JobTitle = "Salesman" },
    new Employee{ Name = "Dwight Schrute", JobTitle = "Salesman" },
    new Employee{ Name = "Andy Bernard", JobTitle = "Salesman" },
};

var image = new ImageBlob("jpeg", File.ReadAllBytes("Image.jpeg"));

var data = new Dictionary<string, object>()
{
    { "employees", employees },
    { "image", image },
};

var context = new TemplateContext(data);

Step 2: Prepare your template

Template

Step 3: Load & render your template

using (var stream = File.OpenRead("EmployeesTemplate.odt"))
{
    var odt = OdfDocument.LoadFrom(stream);
    var template = new OdtTemplate(odt);

    var result = template.Render(context);

    var desktopDir = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
    var outputFile = Path.Combine(desktopDir, "generated.odt");

    result.Save(outputFile);
}

Step 4: Check the generated document out:

Generated Document

License

MaltReport is licensed in the MIT license.

Author: Wei "oldrev" Li [email protected]

  • Copyright (C) 2009 Wei "oldrev" Li
  • Copyright (C) 2010-2016 Sandwych Consulting LLC.
  • Copyright (C) 2017-TODAY Binary Stars Technologies LLC. & Contributors

CREDITS

More Repositories

1

mapmatchingkit

A GPS map-matching library for .NET
C#
67
star
2

brickmover

一个简单的比特币交易所价差套利程序
Python
49
star
3

Nop.Plugin.ExternalAuth.Weixin

NopCommerce 电商系统的微信登录插件
C#
32
star
4

axelor-cookbook-samples

Axelor 二次开发入门视频教程代码范例
Java
31
star
5

Sandwych.QuickGraph

Sandwych.QuickGraph is a port of the awesome QuickGraph to .NET Standard, it provides generic directed/undirected graph datastructures and algorithms for .NET.
C#
27
star
6

NopPaymentWeixin

NopCommerce 的微信支付插件
C#
25
star
7

sandwych-smartconfig

Pure C# Implementation of Various WiFi SmartConfig Protocols: AirKiss and ESPTouch
C#
21
star
8

tids

A Typst template for creating TI-style datasheets
Typst
14
star
9

ep009-axelor-sales-demo

Axelor 平台开发演示视频的模块源代码
Java
13
star
10

EP008-Demo

树莓派连接 SIM800C 开发板 Python 演示脚本
Python
13
star
11

branchie

开源 HTML5 互动视频播放器
TypeScript
10
star
12

jsonrpc

Sandwych.JsonRpc: A JSON-RPC Client For .NET
C#
9
star
13

borneo-doser

An ESP32 based open source aquarium doser
C
6
star
14

STM32BlackPill-RFReceiver-Demo

STM32F103C8T6+PL1167(LT8920)
C
6
star
15

stm32_blackpill_zephyr_ssd1306_demo

A demo for Zephyr RTOS to shows how to using a custom TTF Font with CFB sub-system to prints text on a small OLED screen.
C
5
star
16

SexpressionForLinq

SexpressionForLinq is a LISP-style S-Expression parser to generate dynamic LINQ Expression Tree.
C#
3
star
17

stm32-mini-f411-blinky-zephyr

A Zephyr-RTOS Blinky Demo for BluePill-Like STM32F411CEU6 Development Board
C
3
star
18

os-kernel-dev-demo

A simple demo to implements a Linux or Zephyr-OS like device driver management architecture.
C
2
star
19

axelor-kotlin-module

An Example for Writing an Axelor Module With Kotlin
Kotlin
2
star
20

maltcompress

A multi-threaded data compression library for .NET
C#
2
star
21

esp-idf-smf

A port of the Zephyr RTOS SMF(State Machine Framework) to the ESP-IDF framework.
C
2
star
22

diy-usb2-hub

A super cheap USB 2.0 hub PCBA.
1
star
23

zephyr-nodemcu-esp32-blinky

This is a simple demo to show that how to drive your NodeMCU-ESP32 board with ZephyrRTOS.
CMake
1
star
24

odoodev-demo-2014

昆明技术群聚会 Odoo 开发演示代码
Python
1
star
25

china-administrative-areas

中国行政区划数据
1
star
26

stm32_f407_ili9488_lvgl_demo

A demo for Zephyr RTOS to shows how to using LVGL with a 3.5" TFT LCD.
C
1
star
27

device-tree

A .NET library for parsing Linux Device Tree Source (DTS) files.
C#
1
star
28

report_relatorio

A relatorio powered reporting module for OpenERP
1
star
29

16bit-pwm-dac-board

16-bit PWM-DAC & PWM charge pump evaluation board (drawn using KiCAD 5.99).
HTML
1
star