Wordize for .NET là giải pháp chuyên nghiệp để tự động hóa báo cáo và tạo tài liệu ODT theo chương trình. Lớp ReportBuilder cung cấp cho các nhà phát triển C# khả năng tạo báo cáo ODT sử dụng mẫu và cú pháp LINQ, giúp tăng tốc các quy trình phân tích doanh nghiệp, triển khai nội dung ODT động trong quy trình tài liệu tự động.
Tính năng chức năng:Kiểm tra khả năng tạo báo cáo ODT theo chương trình trong demo trực tuyến tương tác được trình bày trên trang này. Để làm điều này, hãy tải lên mẫu tài liệu, tệp dữ liệu (JSON, XML hoặc CSV), chạy thao tác và tải xuống tài liệu ODT được tạo để xác minh. Đoạn mã C# được cung cấp đã sẵn sàng để sử dụng trong dự án .NET của bạn.
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);
}