8.4. Creating Web Parts from ExcelYou can create custom Spreadsheet web parts from Excel 2003 using the Excel Office Web Part Add-In. Excel web parts can include data bindings, XML Maps, formatting, and complex formulas that are difficult to create from the Spreadsheet web part's browser interface. The add-in doesn't create a new web part assembly, but rather customizes the existing Spreadsheet web part by adding a new web part description (. dwp ) to the site gallery. Before you begin, download and install the components listed in Table 8-5 from http://www.microsoft.com/downloads. Table 8-5. Downloads for Office web parts
Installing the add-in appends the Create Add-In menu to Excel. To create a web part from an existing spreadsheet:
animal 8-10. Creating a spreadsheet web part from Excelanimal 8-11. The add-in displays the publishing status after you choose CreateTo use the new web part from a web part page:
animal 8-12. Importing a web part generated by the Excel add-inImporting the web part makes it available on that one page. To make the web part available to all web part pages on the site, import the web part description into the site gallery:
Since the add-in generated web part description references a solution file stored in a library, the new web part will only work within the site that contains the library. If you try to use the web part outside of that site, you'll see an error like the one in Figure 8-13. You may also bump up against the web part property size limits when working with Spreadsheet web parts. The Loan Calculator sample saves quite a bit of data; if you enter values on the page in Figure 8-12, then go to another page you'll see the warning in Figure 8-14. animal 8-13. You get an error if you use the web part outside its siteanimal 8-14. Warning generated by web part trying to save too much dataTo fix that, you must increase the WebPartLimits PropertySize attribute in the server's Web.config file, as shown here: <WebPartLimits MaxZoneParts="50" PropertySize=" 2048576 " /> Of course, increasing this limit requires additional storage on the server and may affect performance. Be sure to test your settings before deploying them to the production server. |