Displaying Excel DataMaybe displaying data pulled from an Excel file isn't fancy enough for you. What if you want to provide visitors with something like a small mortgage calculator in which they can enter figures and tabulate results? FrontPage offers a spreadsheets and charts Web component that lets you do just that. You can insert what's essentially a miniature version of Excel within your Web page. This component can be in spreadsheet, chart, or pivot table format, and your viewers can interact with it, using some limited Excel controls (see Figure 18-5). Sounds great. So what's the catch? Your visitors need to be completely Microsoft equipped in order to see the component, otherwise they'll be greeted with the not-so-friendly message shown in Figure 18-6. In other words, if you want visitors to see your spreadsheet, not only will they have to view the page with Internet Explorer (version 5.0 or later) and have Excel installed on their system, they'll also need to have Microsoft Office Web Components installed. Office Web Components are automatically installed during a default installation of Office 2003. You can also install them separately from the Office Resource Kit (for more info, visit www.microsoft.com/office). Because of this, you should probably use this feature only if you're sure your visitors have all this software installedas in a corporate intranet, for example. Due to these requirements, Web developers rarely use these components for pages destined for the broader Internet.
Note: Spreadsheet and chart components also require the presence of FrontPage Server Extensions on your Web server. While this is a nifty interactive feature, you'll find that its use is limited. For instance, you can't save any visitor entries to an Excel file or any kind of database. This feature is really just for on-the-fly calculations that might help your readers figure out a monthly payment or special discount. (If you want visitors to add entries to a database through your Web pages, see Tutorial 17 for instructions on using the Database Interface Wizard.) 18.5.1. Adding a Spreadsheet Web ComponentInserting a spreadsheet component is a snap. First, open or create the page you'd like to place it on. Place your cursor where you want the component to appear. Select Insert Note: If the Spreadsheets and Charts option is grayed out, select Tools Enter whatever data you want the spreadsheet to contain. Tip: If you have an existing spreadsheet you want to display, it's actually easier to start the process in Excel. In Excel, choose File 18.5.1.1 Configuring the spreadsheet componentWhen you add a spreadsheet component, FrontPage gives both you and a visitor viewing the file through a browser some controls over spreadsheet display and behavior. As the all-powerful creator, you obviously have more options and can even limit what visitors can and can't do with your spreadsheet. You and your visitors access these controls by clicking the "Commands and Options" button in your spreadsheet component's toolbar (pop back to Figure 18-5 to see what this looks like). When you click this button, you can set all the options you're about to read about. When site visitors click this button, the more limited dialog box shown in Figure 18-7 displays.
The Commands and Options box that authors see has a few more bells and whistles (see Figure 18-8).
To open the Commands and Options dialog box, click the Commands and Options button on the Excel toolbar at the top of the component (see Figure 18-5). The tabs in this dialog box let you do the following:
You can further define visitor abilities by clicking the Protection tab within the Commands and Options dialog box as explained in Figure 18-9.
Make your spreadsheet read-only if you want, by turning on the "Protect active sheet" checkbox. Doing so prohibits visitors from entering or manipulating data in any way. You can also allow some select functions by turning on checkboxes underneath the "Protect active sheet" checkbox. For instance, you can lock the sheet from edits but allow viewers to sort information by turning on the Sort checkbox. If you don't want viewers to have access to the Commands and Options dialog box (see Figure 18-7), turn off the "Commands and Options dialog box" checkbox at the bottom of the Protection tab. If you just want to stop visitors from creating or deleting worksheets, then turn off the "Insert, remove or renamesheets" checkbox just above that. If you do so, FrontPage removes these options from the visitor's Workbook tab within their Commands and Options dialog box. Import data.The spreadsheet component is a simple and limited feature. You're not going to use it to display data from a database (that's what the Database Results and Database Interface Wizards are foras explained in Tutorials 16 and 17). However, you can import data if it's in the form of an HTML file, comma-separated text file (.csv), or an XML file. To do so, open the Commands and Options dialog box and click the Import tab. Select the appropriate file type, then browse to and select the file and click Open. The path and file name appear on the Import tab. Click Import Now and FrontPage populates your spreadsheet component with data from the file. 18.5.2. Adding an Office Chart Web ComponentThe spreadsheet component is great, but what if you want to present data in a graphical format that can really help visitors understand the figures? In that case, you can use the Office Chart Web component. This works a lot like the spreadsheet component, but instead of a spreadsheet, visitors can look at a bar graph or pie chart to analyze and manipulate data. To turn your spreadsheet into a pretty picture, do the following:
18.5.3. Pivot TablePivot tables are a way to glean essential figures when you've got lots of data. Say you've got several months worth of sales data for a bunch of different products, and you want to know which products are selling and which aren't. A pivot table helps you find the answer by quickly and easily sorting through all the info stored in your table. Note: Unfortunately, this book can't help you with the hardest part of this process. Creating pivot tables is an advanced skill. To learn more about them (and all about Excel), take a look at Excel: The Missing Manual. Since you're connecting to a pivot table you created, you already have an Excel file filled with data. So, begin by opening Excel. Next, follow all the steps for converting an Excel file into a Web file (as explained on Section 18.4). When you do so, add the following steps: within the initial Save As dialog box, turn on the Add Interactivity checkbox and then click Publish. A "Publish as Web Page" dialog box displays. Within the "Add interactivity with" dropdown list, select "PivotTable functionality" and click Publish. Excel creates a Web page, which includes a pivot table Web component (see Figure 18-11).
|






