Distributing Reports Using Snapshots

You can make Access reports available to others via the World Wide Web or email using snapshot files. The workstation viewing a snapshot of an Access report requires a Snapshot viewer, which is available for free as a standalone application, and an ActiveX control for use in a web browser. The viewer allows a much wider audience, such as those without Access and those not connected to your LAN, to use your reports. While the Netscape browser does not support ActiveX controls, it can download snapshot files over an http connection. Netscape users can then use the standalone version of the Snapshot viewer with the saved file on their local hard drive.

Creating a Snapshot

You can create a snapshot for a report by selecting the report in the Database window and choosing File-Export. This enters your report name as the name of the snapshot file in the Export Report dialog box. (See Figure 6-12.) In the Save As Type drop-down list box, select Snapshot Format. In the Save In drop-down list box, designate a location for your snapshot file. Figure 6-12 saves the report from Figure 6-9 to a virtual directory (namely, CAB_Office_2000) on an intranet. Clicking Save in the dialog box in Figure 6-12 on the following page opens a progress dialog box and opens the file after saving it in the Snapshot viewer (which ships with Access 2000). The file resides on the server and has an .snp extension.

click to view at full size.

Figure 6-12. Creating a snapshot file manually.

Viewing a Snapshot

A workstation running Microsoft Internet Explorer 3 and later with the viewer installed can open the snapshot file. Figure 6-13 shows the report in Internet Explorer 4. The viewer appears to be inside the browser, but it actually takes over the browser. Special navigator controls on a bar at the bottom of the ActiveX control enable navigation around the pages of a report. The same navigator bar also includes a button for printing (because the control disables the native browser printing functionality).

Notice the close correspondence between the browser image in Figure 613 and the original report image in Figure 6-9. This level of correspondence does not occur when you export to the HTML Documents format. In addition, exporting to HTML does not provide the built-in navigation functionality that the Snapshot viewer control offers.

The Snapshot viewer control lets you embed an Access report on a web page along with other content. The following HTML excerpt shows the body of a web page with H3 and H4 tags before the object reference to the Snapshot viewer control. The text blocks preceding the control explain how to download the viewer if the report does not appear, and they offer a hyperlink to a site from which a user can download the browser. The instructions also explain how to view the report in Netscape Navigator. You typically want to update the SnapshotPath Param value setting to the URL for the snapshot file that you want to show.

<body> <H3>Snapshot Sample page</H3> <H4>If you have an IE 3+ browser but cannot see the report below,  download and install the   <a href="http://www.microsoft.com/accessdev/prodinfo/snapdl.htm">   Microsoft Access Snapshot viewer</a>. Then    refresh the page. Netscape users will not even see the report  container in their browsers, but they can open the report   outside their browser using the same snapshot viewer mentioned   above. Netscape users can download the snapshot file from   a web server over http protocol to their workstation.</H4> <OBJECT ID="SnapshotViewer" WIDTH=640 HEIGHT=480 CLASSID="CLSID:F0E42D60-368C-11D0-AD81-00A0C90DC8D9">     <PARAM NAME="_ExtentX" VALUE="16722">     <PARAM NAME="_ExtentY" VALUE="11774">     <PARAM NAME="_Version" VALUE="65536">     <PARAM NAME="SnapshotPath"     VALUE="http://cab2200/cab_office_2000/MySampleChart.snp">     <PARAM NAME="Zoom" VALUE="0">     <PARAM NAME="AllowContextMenu" VALUE="-1">     <PARAM NAME="ShowNavigationButtons" VALUE="-1"> </OBJECT> </body>

click to view at full size.

Figure 6-13. The report displayed in Internet Explorer 4.

Other Uses for Snapshots

Snapshot files based on Access reports have many other uses as well. For example, you can electronically mail a snapshot file as an attachment by right-clicking on the report in the Database window and choosing Send To and then Mail Recipient from the shortcut menu. Remember to include a link in your message to the download site for the Snapshot viewer. This will enable recipients who do not have the viewer to install it.

You can also use the DoCmd OutputTo and SendObject methods to automate conversion and copying of snapshot files to an intranet web server site or to e-mail recipients. This chapter's final section includes a sample that programmatically e-mails multiple files to one or more recipients. The following statement publishes a report from the Northwind database to a local site on my intranet:

 DoCmd.OutputTo acOutputReport, "Alphabetical List of Products", _     "Snapshot Format", _     "\\cab2200\c\inetpub\cab_office_2000\mysnapshot.snp", True 



Programming Microsoft Access 2000
Programming Microsoft Access 2000 (Microsoft Programming Series)
ISBN: 0735605009
EAN: 2147483647
Year: 1998
Pages: 97
Authors: Rick Dobson

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net