Generate PDF Reports
DynamicPDF Designer combined with DynamicPDF ReportWriter makes creating reports a breeze. Create reports from JSON data, business objects, or a variety of data sources including SQL Server, Oracle, and MySQL databases.
How to Generate PDF Report
DynamicPDF Designer creates PDF report templates (DLEX files) and then ReportWriter combines the data and DLEX to layout and create a PDF report.
Steps to Generate PDF report
- Create a
DocumentLayout
object using a DLEX file as a template. - Create a
NameValueLayoutData
object and add the necessary data. - Add the
Layout
method on theDocumentLayout
to create aDocument
object. - Invoke the
Draw
method on the Document to save the PDF.
Sample Code - C#
string data = File.ReadAllText(Util.GetPath("Resources/Data/SimpleReportWithCoverPage.json"));
var jsonData = JsonConvert.DeserializeObject(data);
DocumentLayout layoutReport = new DocumentLayout(Util.GetPath("Resources/DLEXs/SimpleReportWithCoverPage.dlex"));
NameValueLayoutData layoutData = new NameValueLayoutData();
layoutData.Add("ReportCreatedFor", "Alex Smith");
layoutData.Add("Products", jsonData);
Document document = layoutReport.Layout(layoutData);
document.Draw(Util.GetPath("Output/report-output-example.pdf"));
GitHub Project
Examples are provided in C# and VB.NET. Clone or view the example project at GitHub. The examples are available in these files.
- C# - GenerateReportExample.cs
- VB.NET - GenerateReportExample.vb
Getting Started
Get started easily by installing DynamicPDF Core Suite for .NET through NuGet or manually. Then, refer to the documentation for more information on using and purchasing the product.
NuGet Package
DynamicPDF Generator is available on NuGet and is part of the ceTe.DynamicPDF.CoreSuite.NET
package. The easiest way to install the DynamicPDF Core Suite package is through the Visual Studio Package Manager. You can also download directly from NuGet.
DynamicPDF ReportWriter Information
More information on DynamicPDF Core Suite (ReportWriter) can be found on its webpage.
DynamicPDF Designer Information
More information on DynamicPDF Designer can be found on the DynamicPDF SDK website.
Available on Other Platforms
DynamicPDF ReportWriter PDF Library is also available for COM/AxtiveX platforms. Refer to the product page for more details.
- COM/ActiveX - DynamicPDF ReportWriter for COM/ActiveX