{"id":21317206,"url":"https://github.com/oldrev/maltreport","last_synced_at":"2025-04-06T04:12:22.455Z","repository":{"id":1530663,"uuid":"1813853","full_name":"oldrev/maltreport","owner":"oldrev","description":"A WYSIWYG document template engine to generates .odt/.ods/docx/xlsx/doc/xls documents for .NET","archived":false,"fork":false,"pushed_at":"2022-08-20T15:32:44.000Z","size":13554,"stargazers_count":126,"open_issues_count":6,"forks_count":27,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-17T09:35:28.210Z","etag":null,"topics":["c-sharp","libreoffice","opendocument"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"NilStack/NKWatchChart","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oldrev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-05-28T11:34:24.000Z","updated_at":"2024-10-24T02:21:57.000Z","dependencies_parsed_at":"2022-08-16T13:40:11.119Z","dependency_job_id":null,"html_url":"https://github.com/oldrev/maltreport","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oldrev%2Fmaltreport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oldrev%2Fmaltreport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oldrev%2Fmaltreport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oldrev%2Fmaltreport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oldrev","download_url":"https://codeload.github.com/oldrev/maltreport/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430873,"owners_count":20937874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-sharp","libreoffice","opendocument"],"created_at":"2024-11-21T18:42:26.366Z","updated_at":"2025-04-06T04:12:22.251Z","avatar_url":"https://github.com/oldrev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# MaltReport\n\n[![NuGet Stats](https://img.shields.io/nuget/v/MaltReport2.svg)](https://www.nuget.org/packages/MaltReport2) \n[![Build status](https://ci.appveyor.com/api/projects/status/7kj4cnl64negfdn6/branch/master?svg=true)](https://ci.appveyor.com/project/oldrev/maltreport/branch/master)\n[![Build Status](https://travis-ci.org/oldrev/maltreport.svg?branch=master)](https://travis-ci.org/oldrev/maltreport)\n\n**PLEASE NOTE**: \n* At this very moment I'm rewriting the old library, the next coming v3.0 will be an incompatible version;\n* I'm also working on a additional commerce library for the docx/xlsx support, closed-source library for MS-Office seems fair;\n* The super old and buggy OfficeML support will be dropped, the OfficeML format is a legacy from 2003;\n* More real world unit tests, more documents;\n* Check `dev` branch to track the progress of the incoming v3 series.\n\nMaltReport is an OpenDocument/OfficeOpenXML powered document template engine for .NET and Mono, \nit is inspired by the excellent [Relatorio Project](http://relatorio.openhex.org/).\n\nThere is a briefly introduction in Chinese: [MaltReport2 中文使用简介](http://www.cnblogs.com/oldrev/p/maltreport2_intro.html)\n\nMaltReport DO NOT REQUIRES MS-Office or LibreOffice to generate document. \nInstead MaltReport manipulates ODT/ODS/XLS/DOC file by itself, so it could be fast \u0026 reliable.\n\n## Documents\n\n* [Wiki](https://github.com/oldrev/maltreport/wiki)\n\n## Getting Started\n\n### Prerequisites\n\n* Visual Studio 2017: This project is written in C# 7.0 using Microsoft Visual Studio 2017 Community Edition.\n\n### Supported Platform\n\n* .NET Framework 4.6.1\n* .NET Standard 1.6+\n\n### Installation\n\nMaltReport can be installed from [NuGet](https://www.nuget.org/packages/MaltReport2).\n\n## Demo \u0026 Usage:\n\n### Step 1: Organize your data into Context\n\n```csharp\nvar employees = new Employee[]\n{\n    new Employee{ Name = \"Micheal Scott\", JobTitle = \"Branch Manager\" },\n    new Employee{ Name = \"Pam Beesly\", JobTitle = \"Office Administrator\" },\n    new Employee{ Name = \"Jim Halpert\", JobTitle = \"Salesman\" },\n    new Employee{ Name = \"Dwight Schrute\", JobTitle = \"Salesman\" },\n    new Employee{ Name = \"Andy Bernard\", JobTitle = \"Salesman\" },\n};\n\nvar image = new ImageBlob(\"jpeg\", File.ReadAllBytes(\"Image.jpeg\"));\n\nvar data = new Dictionary\u003cstring, object\u003e()\n{\n    { \"employees\", employees },\n    { \"image\", image },\n};\n\nvar context = new TemplateContext(data);\n```\n\n### Step 2: Prepare your template\n\n![Template](https://github.com/oldrev/maltreport/raw/dev/screenshots/hello-world/template.png)\n\n### Step 3: Load \u0026 render your template\n\n```csharp\n\nusing (var stream = File.OpenRead(\"EmployeesTemplate.odt\"))\n{\n    var odt = OdfDocument.LoadFrom(stream);\n    var template = new OdtTemplate(odt);\n\n    var result = template.Render(context);\n\n    var desktopDir = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);\n    var outputFile = Path.Combine(desktopDir, \"generated.odt\");\n\n    result.Save(outputFile);\n}\n```\n\n### Step 4: Check the generated document out:\n\n![Generated Document](https://github.com/oldrev/maltreport/raw/dev/screenshots/hello-world/generated.png)\n\n\n## License\n\nMaltReport is licensed in the MIT license.\n\nAuthor: Wei \"oldrev\" Li \u003coldrev@gmail.com\u003e\n\n* Copyright (C) 2009 Wei \"oldrev\" Li\n* Copyright (C) 2010-2016 Sandwych Consulting LLC.\n* Copyright (C) 2017-TODAY Binary Stars Technologies LLC. \u0026 Contributors\n\n## CREDITS\n\n* [Fluid](https://github.com/sebastienros/fluid)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foldrev%2Fmaltreport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foldrev%2Fmaltreport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foldrev%2Fmaltreport/lists"}