MindFusion.Wpf Pack Programmer's Guide
ImageRenderTarget Class
Remarks See Also
 





An implementation of the IRenderTarget, which renders a report to an image.

Namespace: MindFusion.Reporting.Wpf
Assembly: MindFusion.Reporting.Wpf

 Syntax

C#  Copy Code

public class ImageRenderTarget : IRenderTarget

Visual Basic  Copy Code

Public Class ImageRenderTarget
    Implements IRenderTarget

 Remarks

This class allows reports to be exported as images. To learn more about how to use it, check Exporting Reports.

 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

ImageRenderTarget Members
MindFusion.Reporting.Wpf Namespace