Wordize Reporting สำหรับ .NET — โซลูชันนวัตกรรมสำหรับการสร้างเอกสาร PDF แบบโปรแกรมที่ช่วยให้นักพัฒนา C# สามารถอัตโนมัติกระบวนการสร้างรายงานที่มีความซับซ้อนทุกระดับ ผสานการสร้างรายงานเข้ากับโปรเจกต์ C# ของคุณและแปลงไฟล์ JSON, XML ให้เป็นเอกสาร PDF ระดับมืออาชีพ
ประโยชน์หลักของการสร้างรายงาน PDF ใน C#:
เพื่อเข้าใจวิธีการสร้างไฟล์ PDF ใน C# โดยใช้ API การสร้างเอกสาร อัปโหลดเอกสารเทมเพลตและไฟล์ข้อมูล (XML, JSON, CSV) ผ่านแบบฟอร์ม ระบุชื่อออบเจกต์แหล่งข้อมูลที่ใช้ในเทมเพลต และเริ่มการสร้างไฟล์ PDF แบบโปรแกรม หลังจากรันเดโม ดาวน์โหลดเอกสาร PDF ที่สร้างขึ้นและตรวจสอบการแทนที่ข้อมูลที่ถูกต้องจากไฟล์ต้นฉบับที่ระบุ
using Wordize.Reporting;
var dataSource = new JsonDataSource("data.json");
ReportBuilder.BuildReport("Input.pdf", "Output.pdf", dataSource, "");
using Wordize.Reporting;
var dataSource = new JsonDataSource("data.json");
ReportBuilder.BuildReport("Input.pdf", "Output.pdf", dataSource, "");
using Wordize.Reporting;
using Wordize.Saving;
var dataSource = new JsonDataSource("data.json");
var imageStreams = ReportBuilder.BuildReportToImages("Input.pdf",
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.pdf", "Output.pdf", dataSource, "");
using Wordize.Reporting;
var dataSource = new XmlDataSource("data.xml");
ReportBuilder.BuildReport("Input.pdf", "Output.pdf", dataSource, "");
using Wordize.Reporting;
using Wordize.Saving;
var dataSource = new XmlDataSource("data.xml");
var imageStreams = ReportBuilder.BuildReportToImages("Input.pdf",
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.pdf", "Output.pdf", dataSource, "");
using Wordize.Reporting;
var dataSource = new CsvDataSource("data.csv", new CsvDataLoadOptions() { HasHeaders = true });
ReportBuilder.BuildReport("Input.pdf", "Output.pdf", dataSource, "");
using Wordize.Reporting;
using Wordize.Saving;
var dataSource = new CsvDataSource("data.csv", new CsvDataLoadOptions() { HasHeaders = true });
var imageStreams = ReportBuilder.BuildReportToImages("Input.pdf",
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);
}