Exporting Reports to HTML

You can export an Access report to HTML in a manner similar to that for table or query datasheets. Unlike static datasheets, exporting a multipage report creates multiple Web pages, one for each page of the report. Office 97 includes a special template, Nwindtem.htm in the ...OfficeSamples folder, specifically designed for reports. Nwindtem.htm, shown in Figure 17.17, includes hyperlinks to provide paging through of multipage reports.

Figure 17.17. The Nwindtem.htm template for exported Access reports.


Figure 17.18 shows the HTML source for Nwindtem.htm in Notepad. <META ...> tags provide HTML metadata to indicate the type of content of the page and other information to aid the browser in formatting the document. The <A HREF=...>Position</A> anchor tags provide First, Previous, Next, and Last navigation hyperlinks at the bottom of each report page.

Figure 17.18. The HTML source for the Nwindtem.htm report template with navigation hyperlinks.


Note

You can only export Access Reports to static Web pages. This limitation is logical because a Web page is the equivalent of a printed report, which must be physically replaced when updated. Unlike Word 97's File, Export to HTML menu choice, the exporting process for Access 97 reports doesn't process graphic images. If you want to add graphics to a report beyond the image(s) added by the template, you must create a .gif, .jpg, or .png file from each graphic image of the report, then manually add a <IMG SRC="filename.ext"> tag in the appropriate location of each report page. The graphics files must be located in the same folder as the associated .html file, unless you add a well-formed path to the filename.ext element of the tag.


To export the Catalog report of Northwind.mdb to a series of Web pages using Nwindtem.htm to add a logo and navigation features, follow these steps:

1.
Open the Catalog report in Preview mode.

Note

If you haven't copied the graphics files required for your template file to the folder in which you intend to store the .html files of the Catalog report, do so at this point. Step 2 in the preceding section describes how to copy the required graphics files.

2.
Choose File, Save As, select the To an External File or Database option, and click OK to open the Save Report "Catalog" In dialog. Select HTML Files (*.html, *.htm) in the Files of Type drop-down list and mark the Autostart check box. (The Save Formatted check box is marked and disabled; you can't export an unformatted report.) Click Export to continue.

3.
When the HTML Options dialog appears, click the Browse button and select the Nwindtem.htm template in the HTML Template to Use dialog.

4.
Click OK to complete the export process and open the first page of the Catalog report in your browser (see Figure 17.19). As expected, the large Northwind Traders graphic is missing from the first p age, Catalog.html.

Figure 17.19. The first Web page (Catalog.html) of the exported Catalog report.


5.
Click the Next hyperlink to proceed to the second page of the Catalog, then scroll to the bottom of the page and click the Next button to display the third page (see Figure 17.20). When you export a report, the Access export feature appends Page# to the file name of the report for pages 2 and higher.

6.
Choose View, Source from IE 3.0 to display the HTML source for CatalogPage3. html in Notepad, then scroll to the bottom of the file (see Figure 17.21). Each page of a report has a different set of HTML Previous and Next anchor lines for navigation. For page 3 of the catalog, the Previous and Next anchor lines are <A HREF="CatalogPage2.html">Previous</A> and <A HREF="CatalogPage4.html">Next </A>, respectively. The First ( <A HREF="Catalog.html">First</A>) and Last (<A HREF="CatalogPage9.html">Last</A>) anchors are the same for all pages of the report.

Reports are formatted as HTML tables without borders (<TABLE BORDER=0>), which emulates on a Web page the appearance of Access 97's reports in Preview mode and when printed. As a general rule, Access reports are the best choice for exporting large amounts of data to Web pages. You have much more control over the appearance of the Web page with exported reports than when you export a datasheet with the same content. To optimize the appearance of Web pages created from reports, you must design the report specifically for export to HTML.

Figure 17.20. The third Web page (CatalogPage3.html) of the Catalog report.


Figure 17.21. The anchor tags of the third page (CatalogPage3.html) of the Catalog report.


Note

Report formatting fails for complex reports that contain a combination of graphic elements and text. As an example, compare the last Web page (CatalogPage9.html) of the Catalog series with the last page of the Catalog report in Access' Report Preview mode. All of the graphic elements in the order form are missing from the last Web page.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.8.247