windowsforms-3244-controls-and-libraries-printing-exporting-examples-using-printing-links-how-to-use-link-events-complete-sample.md
This example demonstrates how to use an empty link (shipped with the XtraPrinting Library ) to create a report that it is not very complex. An empty link allows you to populate your report section by section based on applicable events.
To render a report using link events, do the following.
Drop the DocumentViewer component from the DX.25.2: Reporting Toolbox tab onto the main form of your application.
To add a printing system to the print preview, select the Document Viewer and click its smart tag. Next, expand the DocumentViewer.DocumentSource property drop-down list, and select the PrintingSystem item in the Standard Sources category.
Select the printing system component, switch to the Properties window and click the ellipsis button for the Links property. In the invoked Link Collection Editor window, click the Add button, and then, select the DevExpress.XtraPrinting.Link item to create an empty Link instance and add it to the collection.
Select the created link and switch to the event page by clicking the Events button . Double-click the right column for the LinkBase.CreateMarginalHeaderArea, LinkBase.CreateDetailHeaderArea, LinkBase.CreateDetailArea and LinkBase.CreateDetailFooterArea events, and click OK to close the dialog.
Using these events, you can create your report as demonstrated below.
Run the application, and view the result.
See Also