Represents a report item that provides a way to render custom contents within the report.
Namespace: MindFusion.Reporting
Assembly: MindFusion.Reporting
C# Copy Code |
---|
public class Canvas : ReportItem |
Visual Basic Copy Code |
---|
Public Class Canvas |
The Canvas element does not provide any visualization by default. In order to perform rendering through the Canvas, you need to handle its RenderContents event and place the custom drawing code in the event handler.
The following example illustrates how to render a rectangle using a Canvas object. The example assumes that canvas1 is a variable that references a valid Canvas instance.
C# Copy Code |
---|
canvas1.RenderContents += new DrawCanvasEventHandler(this.OnDrawCanvas); |
Visual Basic Copy Code |
---|
AddHandler(canvas1.RenderCanvas, AddressOf Me.OnDrawCanvas) |
The Canvas element can be data-bound, similarly to a Label or a Picture. In this case, the value retrieved from the data source can be accessed through the DataValue property of the DrawCanvasEventArgs object passed to the RenderContents event handler. The type of this value depends on the type of the field the Canvas is data-bound to.
To learn more about data-binding, visit the Binding Reports to a Data Source.
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
MindFusion.Reporting.ReportItem
MindFusion.Reporting.Canvas