Wordize Reporting cho .NET — một giải pháp sáng tạo để tạo tài liệu theo chương trình giúp các lập trình viên C# tự động hóa việc tạo báo cáo với mọi độ phức tạp. Tích hợp việc tạo báo cáo vào dự án C# của bạn và chuyển đổi các file JSON, XML thành tài liệu Word và văn bản PDF chuyên nghiệp.
Lợi ích chính của việc Tạo Báo Cáo bằng C#:
Để hiểu cách tạo báo cáo bằng C# sử dụng API Tạo Báo Cáo, hãy tải lên tài liệu mẫu và file dữ liệu (XML, JSON, CSV) thông qua biểu mẫu. Xác định tên đối tượng nguồn dữ liệu được sử dụng trong mẫu và bắt đầu tạo tài liệu theo chương trình. Sau khi chạy bản demo, tải xuống báo cáo đã tạo và xác minh việc thay thế dữ liệu chính xác từ file nguồn được chỉ định.
using Wordize.Reporting;
var dataSource = new JsonDataSource("data.json");
ReportBuilder.BuildReport("Input.docx", "Output.pdf", dataSource, "");
using Wordize.Reporting;
var dataSource = new JsonDataSource("data.json");
ReportBuilder.BuildReport("Input.docx", "Output.pdf", dataSource, "");
using Wordize.Reporting;
using Wordize.Saving;
var dataSource = new JsonDataSource("data.json");
var imageStreams = ReportBuilder.BuildReportToImages("Input.docx",
new ImageSaveOptions(SaveFormat.Pdf), 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}.pdf");
stream.CopyTo(file);
}
using Wordize.Reporting;
var dataSource = new XmlDataSource("data.xml");
ReportBuilder.BuildReport("Input.docx", "Output.pdf", dataSource, "");
using Wordize.Reporting;
var dataSource = new XmlDataSource("data.xml");
ReportBuilder.BuildReport("Input.docx", "Output.pdf", dataSource, "");
using Wordize.Reporting;
using Wordize.Saving;
var dataSource = new XmlDataSource("data.xml");
var imageStreams = ReportBuilder.BuildReportToImages("Input.docx",
new ImageSaveOptions(SaveFormat.Pdf), 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}.pdf");
stream.CopyTo(file);
}
using Wordize.Reporting;
var dataSource = new CsvDataSource("data.csv", new CsvDataLoadOptions() { HasHeaders = true });
ReportBuilder.BuildReport("Input.docx", "Output.pdf", dataSource, "");
using Wordize.Reporting;
var dataSource = new CsvDataSource("data.csv", new CsvDataLoadOptions() { HasHeaders = true });
ReportBuilder.BuildReport("Input.docx", "Output.pdf", dataSource, "");
using Wordize.Reporting;
using Wordize.Saving;
var dataSource = new CsvDataSource("data.csv", new CsvDataLoadOptions() { HasHeaders = true });
var imageStreams = ReportBuilder.BuildReportToImages("Input.docx",
new ImageSaveOptions(SaveFormat.Pdf), 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}.pdf");
stream.CopyTo(file);
}
Sản phẩm của chúng tôi hoàn toàn đa nền tảng và hỗ trợ tất cả các triển khai .NET chính:
Vì mã .NET không phụ thuộc vào phần cứng hoặc hệ điều hành cơ bản mà chỉ phụ thuộc vào Máy ảo, bạn có thể tự do phát triển bất kỳ loại phần mềm nào cho Windows, macOS, Android, iOS và Linux. Chỉ cần đảm bảo rằng bạn đã cài đặt phiên bản tương ứng của .NET Framework, .NET Core, Windows Azure, Mono hoặc Xamarin.
Chúng tôi khuyên bạn nên sử dụng các môi trường phát triển tích hợp Microsoft Visual Studio, Xamarin và MonoDevelop để tạo các ứng dụng C#, F#, VB.NET.