An implementation of the IRenderTarget, which renders a report to an image.
Namespace: MindFusion.Reporting.Wpf
Assembly: MindFusion.Reporting.Wpf
Syntax
Visual Basic
Copy Code
|
---|
Public Class ImageRenderTarget Implements IRenderTarget |
Example
The following example creates a new report with a label on it and exports it as PNG. The exported pages have white background and black border.
C#
Copy Code
|
---|
Report report = new Report(); report.Pages.Add(new MindFusion.Reporting.Page()); report.Pages[0].Items.Add(new MindFusion.Reporting.Label() { Text = "Hello world!" });
report.Run();
ReportLayout layout = report.Layout(New Size(8.5 * 96, 11 * 96), New Thickness(0.5 * 96), MindFusion.Reporting.PageOrientation.Portrait);
ImageRenderTarget renderTarget = new ImageRenderTarget(); renderTarget.PageBackground = Brushes.White; renderTarget.PageBorderBrush = Brushes.Black;
layout.RenderAllPages(renderTarget);
renderTarget.Save("helloworld.png"); |
Visual Basic
Copy Code
|
---|
Dim report As New Report report.Pages.Add(New MindFusion.Reporting.Page()) report.Pages(0).Items.Add(New MindFusion.Reporting.Label() With {.Text = "Hello world!"})
report.Run()
Dim layout = report.Layout(New Size(8.5 * 96, 11 * 96), New Thickness(0.5 * 96), _ MindFusion.Reporting.PageOrientation.Portrait)
Dim renderTarget = New ImageRenderTarget() renderTarget.PageBackground = Brushes.White renderTarget.PageBorderBrush = Brushes.Black
layout.RenderAllPages(renderTarget)
renderTarget.Save("helloworld.png") |
Inheritance Hierarchy
System.Object
MindFusion.Reporting.Wpf.ImageRenderTarget
See Also