In order to display a report in a DocumentViewer it needs to be processed, laid out and rendered to a FixedDocument object. To learn more about these operations, check the Running, Laying Out and Rendering topic. Once the report is rendered in a FixedDocument all that needs to be done is assigning that document to the DocumentViewer's Document property.
The following code illustrates all necessary steps. The code assumes that report and viewer are variables identifying existing Report and DocumentViewer objects respectively.
C# Copy Code |
---|
report.Run(); |
Visual Basic Copy Code |
---|
report.Run() |