ActiveReports Developer 7
RDF Viewer Sample
See Also Support Forum
ActiveReports Developer 7 > ActiveReports Developer Guide > Samples and Walkthroughs > Samples > Section Report > Preview > RDF Viewer Sample

Glossary Item Box

The RDF Viewer sample is used to view RDF files. It consists of an RdfViewerForm with an ActiveReports Viewer control and an ExportForm with a Property Grid. The sample also contains a RDFs folder of saved reports.


ShowSample Location

ShowVisual Basic.NET

<User Folder>\ComponentOne Samples\ActiveReports Developer 7\Section Reports\VB.NET\Peview\RDFViewer

ShowC#

<User Folder>\ComponentOne Samples\ActiveReports Developer 7\Section Reports\C#\Preview\RDFViewer

ShowRuntime features

When you run the sample, a Viewer control containing File and View menu appears on the top. Following options are available in given menus.

File menu

  • Open: Loads any of the six given RDF files
  • Export: Exports file to HTML, Excel, Text, PDF, RTF or TIFF format
  • Print: Prints the loaded RDF file
  • Exit: Closes the application

View menu

  • TocView: Shows or hides all the report pages as thumbnails in the left pane
  • Toolbar: Shows or hides Viewer toolbar

ShowProject Details

ShowExportForm

This form contains a Combobox to collect the user-selected export format, a property grid to display properties for the selected format, and an OK button to export the report to the selected format. It also contains a Save dialog. Right-click the form and select View Code to see how this is done.

The Export Format ComboBox's SelectedIndexChanged event sets the cmbExportFormat variable to the selected export type. The cmbExportFormat variable is picked up in the OK button Click event, and then the report Document is pulled from the Viewer and exported to the selected format.

ShowRdfViewerForm

This form contains an ActiveReports Developer Viewer control with its Dock property set to Fill. This ensures that the viewer resizes along with the form at run time. It also contains a MenuStrip and an OpenFile dialog. To see the code implementation of this form, right-click the form and select View Code.

The Click event of the Open option in the File menu filters to show only RDF files and opens the Open File dialog to the RDFs folder. The dlgOpenFile_FileOK event loads the selected RDF file into the Viewer control. The Click event of the Export option in the File menu opens a new ExportForm. For more information on the Viewer control, see Using the Viewer.

ShowRDFs folder

An RDF file is a static copy of a report saved to the native Report Document Format. This can be loaded into the Viewer control without running it or accessing data. For more information, see Save and Load RDF Report Files.

The following five reports are included in this sample:

  • Catalog.rdf
  • Customer Labels.rdf
  • Employee Profiles.rdf
  • Employee Sales.rdf
  • Invoice.rdf
  • Letter.rdf

See Also

Getting Started
Using the Viewer

©2014. ComponentOne, a division of GrapeCity. All rights reserved.