Bahasa Indonesia Français Tiếng Việt العربية English Italiano Türkçe فارسی Español Português Русский ไทย

ODT Document Generation in C#

Wordize Reporting for .NET — an innovative solution for programmatic ODT document generation that helps C# developers automate the creation of reports of any complexity. Integrate report generation into your C# projects and transform JSON, XML files into professional ODT documents.

Key benefits of ODT Report Generation in C#:

  • Quick integration with business processes through .NET API
  • Easy maintenance and updating of document templates
  • Built-in integration with external data sources in JSON, XML, CSV formats
  • Integration with any other data sources using collections of programming objects in C# code
  • Document templating using placeholder fields like '<<[field_name]>>' and LINQ Reporting Engine technology, allowing functional-style data manipulation
  • Detailed configuration of the ODT document generation process through the ReportBuilderOptions class
  • Ability to work with input/output streams for memory optimization

Automation Scenarios for ODT Documents

  • Programmatic generation of contracts with customer data
  • Creation of invoices and commercial proposals
  • Generation of financial reports based on accounting data
  • Formation of technical specifications based on project data

Create ODT File in C#

To understand how to create ODT files in C# using the Report Generation API, upload your template document and data file (XML, JSON, CSV) through the form. Specify the name of the data source object used in the template, and start the programmatic ODT file generation. After running the demo, download the created ODT document and verify the correct substitution of data from the specified source file.

C#
Run code
Upload document template
Upload data file
Select output format from the list
using Wordize.Reporting;

var dataSource = new JsonDataSource("data.json");
ReportBuilder.BuildReport("Input.odt", "Output.odt", dataSource, "");
using Wordize.Reporting; var dataSource = new JsonDataSource("data.json"); ReportBuilder.BuildReport("Input.odt", "Output.odt", dataSource, ""); using Wordize.Reporting; using Wordize.Saving; var dataSource = new JsonDataSource("data.json"); var imageStreams = ReportBuilder.BuildReportToImages("Input.odt", new ImageSaveOptions(SaveFormat.Odt), new[] { dataSource }, new[] { "" }); foreach (var (stream, page) in imageStreams.Select((s, i) => (s, i))) { using var _ = stream; stream.Position = 0; using var file = File.Create($"Output_{page + 1}.odt"); stream.CopyTo(file); }
using Wordize.Reporting;

var dataSource = new XmlDataSource("data.xml");
ReportBuilder.BuildReport("Input.odt", "Output.odt", dataSource, "");
using Wordize.Reporting; var dataSource = new XmlDataSource("data.xml"); ReportBuilder.BuildReport("Input.odt", "Output.odt", dataSource, ""); using Wordize.Reporting; using Wordize.Saving; var dataSource = new XmlDataSource("data.xml"); var imageStreams = ReportBuilder.BuildReportToImages("Input.odt", new ImageSaveOptions(SaveFormat.Odt), new[] { dataSource }, new[] { "" }); foreach (var (stream, page) in imageStreams.Select((s, i) => (s, i))) { using var _ = stream; stream.Position = 0; using var file = File.Create($"Output_{page + 1}.odt"); stream.CopyTo(file); }
using Wordize.Reporting;

var dataSource = new CsvDataSource("data.csv", new CsvDataLoadOptions() { HasHeaders = true });
ReportBuilder.BuildReport("Input.odt", "Output.odt", dataSource, "");
using Wordize.Reporting; var dataSource = new CsvDataSource("data.csv", new CsvDataLoadOptions() { HasHeaders = true }); ReportBuilder.BuildReport("Input.odt", "Output.odt", dataSource, ""); using Wordize.Reporting; using Wordize.Saving; var dataSource = new CsvDataSource("data.csv", new CsvDataLoadOptions() { HasHeaders = true }); var imageStreams = ReportBuilder.BuildReportToImages("Input.odt", new ImageSaveOptions(SaveFormat.Odt), new[] { dataSource }, new[] { "" }); foreach (var (stream, page) in imageStreams.Select((s, i) => (s, i))) { using var _ = stream; stream.Position = 0; using var file = File.Create($"Output_{page + 1}.odt"); stream.CopyTo(file); }
Run code

How to generate reports in C#

  1. Install Wordize for .NET
  2. Add a reference to the library (import the library) in your C# project
  3. Specify document template and data source (JSON, XML, CSV, object collection in code)
  4. Generate document based on template and data
5%