MindFusion WinForms Programmer's Guide
ReportLayout Class
Remarks See Also
 





Encapsulates the state of a laid out Report object. To create an instance of this class, call the Layout method of the Report class.

Namespace: MindFusion.Reporting
Assembly: MindFusion.Reporting

 Syntax

C#  Copy Code

public sealed class ReportLayout

Visual Basic  Copy Code

Public NotInheritable Class ReportLayout

 Remarks

You cannot instantiate from this class directly. Instead, invoke the Layout method of an existing Report object, which has been previously processed by a call to its Run method. The ReportLayout objects encapsulate the layout of the report, that is, the page split up and the position of individual report items.

Once you obtain a ReportLayout object you can perform several operations on it. The PageCount property returns the total number of pages in the layout. Individual pages can be rendered to an IGraphics object by calling the DrawPage method. The orientation and physical size of a page can be obtained through the GetPageOrientation and GetPageSize methods respectively.

 Example

The following example creates a ReportLayout from an existing report and renders its 10th page to a GDI+ Graphics object. The example assumes that report1 is a variable identifying an existing Report, which has been previously processed through a call to its Run method and that graphics is a variable identifying existing GDI+ Graphics.

C#  Copy Code

// Layout the report
ReportLayout layout = report1.Layout(new SizeF(210, 297), new Margins(20), PageOrientation.Portrait);

// Create the drawing context and the target IGraphics
DrawContext context = new DrawContext(report1);
GdiGraphics target = new GdiGraphics(graphics);

// Draw the page
layout.DrawPage(target, 9, context);

Visual Basic  Copy Code

' Layout the report
Dim layout As New ReportLayout = report1.Layout(New SizeF(210, 297), New Margins(20), PageOrientation.Portrait)

' Create the drawing context and the target IGraphics
Dim context As New DrawContext(report1)
Dim target As New GdiGraphics(graphics)

' Draw the page
layout.DrawPage(target, 9, context)

 Inheritance Hierarchy

System.Object
    MindFusion.Reporting.ReportLayout

 See Also

ReportLayout Members
MindFusion.Reporting Namespace