This sample illustrates using SVG (Scalable Vector Graphics) as image format in ActiveReports through third-party assembly, Svg (SVG Rendering Library, see in NuGet packages). The use of SVG for rendering improves the precision of graphics significantly, so that even complex graphics look sharp and crisp.
TestDesignerPro
TestViewer
Sample Location
Visual Basic.NET
<User Folder>\Documents\GrapeCity Samples\ActiveReports 13\Advanced\PageAndRDL\SvgImage\VB.NET
C#
<User Folder>
\Documents\GrapeCity Samples\ActiveReports 13\Advanced\PageAndRDL\SvgImage\C#
Details
When you run this sample, an RDL report with an SVG image is displayed. You may need to install Svg library; the steps are as follows:
- Open "Package Manager Console".
- Use "Install-Package -Id Svg" command.
- Select the project in the Solution Explorer and click Refresh in toolbar.
The sample consists of the following projects:
- SvgImage: It implements IReportItem and IGraphicsRenderer interfaces to create custom SVG image report item, SvgImage.
- SvgDesigner: The designer is inherited from CustomReportItemDesigner class. For design-time rendering, SvgControlGlyph class implements overriding ControlGlyph property of the designer. In this glyph, the MovableBehavior method implements moving and resizing of the Svg Image control.
- TestDesignerPro: This is the default startup project. On running this project, an RDL report with an SVG image is displayed on the designer. You can change its properties from the Properties pane. You can also drag and drop and use the SVGImage control available on the toolbox.
- TestViewer: On running this project, an SVG image is rendered in the Windows Forms Viewer.