If Reporting Services only allowed you to view reports in the preview format when using Visual Studio and in a browser when using the Report Manager, it would be an interesting tool. The fact that reports can be delivered in a number of other presentation formats while maintaining their basic look and feel makes Reporting Services a very powerful tool. Adding the ability to transfer information using a pair of data exchange formats further enhances the flexibility of Reporting Services.
We will look at each of the export formats in detail later in this chapter. First, let’s look at how the export process works in Visual Studio. We will try exporting a report and then displaying it with the appropriate viewer. Then, we will print the report from Visual Studio.
Follow these steps to export a report.
If you have downloaded the Chapter09 project, open this project, double-click the RenderingTest report, and select the Preview tab. If you have not downloaded the Chapter09 project, open your favorite report project from one of the previous chapters, double-click a report, and select the Preview tab. The report will be displayed in the preview format.
Expand the Bolimite row and the 2002 column in the matrix.
Click the Export button in the toolbar below the Preview tab. You will see a drop-down list showing all the available export formats, as shown in Figure 9-1.
Figure 9-1: The Export button on the Preview tab
Select any of the available formats. (Choose one of the presentation formats to make this a more interesting example.) The Exporting dialog box will appear.
After a few moments, the Save As dialog box will appear over the top of the Exporting dialog box. Select the folder where you want the export file to be created. Modify the filename if you desire.
The Export dialog box will disappear after the export file is created. The report has now been exported or rendered in the selected format.
Follow these steps to view the report.
To view the export file, open Windows Explorer.
Navigate to the folder where the export file was created.
Double-click the export file. Windows will open the export file using the appropriate application for viewing this type of file. (We will cover viewer requirements as we discuss each export format later in this chapter.)
Follow these steps to print the report.
Return to the Preview tab in Visual Studio.
Click the Print Preview button on the toolbar below the Preview tab. The contents of the Preview tab will be replaced by the print preview, as shown in Figure 9-2.
Figure 9-2: The Print Preview button on the Preview tab
Use the drop-down list in the toolbar below the Preview tab to zoom in or zoom out as needed.
Click the Print button just to the left of the Print Preview button. The Print dialog box will appear.
Note | You must be in Print Preview mode for the Print button to be active. |
Select the appropriate printer, set the necessary printer properties, and then click OK. Your report will be printed.