Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FILE: OWCHelpr.exe Demonstrates Automation to Excel for Printing a PivotTable Component on a Web Page


View products that this article applies to.

This article was previously published under Q262827

↑ Back to the top


Summary

OWCHelpr.exe is a sample that illustrates how you can use Automation to Microsoft Excel to print a PivotTable component on a Web page. OWCHelpr.exe contains an ActiveX DLL that copies a PivotTable to the clipboard, pastes it to a new Microsoft Excel workbook, and formats the workbook for printing.

OWCHelpr.exe is a sample that demonstrates how you can overcome some of the printing limitations you might encounter while printing a PivotTable component from Internet Explorer. A common problem is printing a PivotTable that is wider than the width of a page; in this situation, the portion of the PivotTable that exceeds the page width is often omitted in the printed output. You can avoid this by using Automation to Excel to print the contents of the PivotTable.

NOTE: For your clients to use this helper DLL for PivotTable printing, they must have Microsoft Excel installed.

↑ Back to the top


More information

The following file is available for download from the Microsoft Download Center:
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591� How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

Files Included with OWCHelpr.exe

OWCHelpr.exe contains the following files:
  • The Source files for the OWCHelper ActiveX DLL: OWCHelper.vbp and XLPrint.cls
  • An Internet Package for the OWCHelper ActiveX DLL: OWCHelper.cab
  • A Sample Web Page: PrintPivotInXL.htm

How to Use the Sample Files

The sample Web page (PrintPivotInXL.htm) that is included with this download illustrates how you can use the OWCHelper ActiveX DLL from a Web page containing a PivotTable component. The steps below walk you through a demonstration by using the sample Web page:
  1. Create a new folder named OWCHelper on your Web server. (Note: The Web server root is C:\Inetpub\wwwroot, by default.)
  2. Download and extract the contents of OWCHelpr.exe to the folder you created.
  3. Start Internet Explorer and navigate to:

    http://ServerName/OWCHelper/PrintPivotInXL.htm

    (where ServerName is the name of your Web server). A Web page containing a PivotTable is rendered.
  4. Filter, expand, or collapse fieldsets in the PivotTable on the Web page as you want.
  5. Select either the Portrait or Landscape option for the page orientation.
  6. Click Print or Print Preview.
    • If you click Print, the OWCHelper ActiveX dll transfers the contents of the PivotTable to a new Excel worksheet and then prints the worksheet. Excel is not made visible and quits when the print job is complete.
    • If you click Print Preview, the OWCHelper ActiveX dll transfers the contents of the PivotTable to a new Excel worksheet and the worksheet is displayed in print preview mode. In print preview mode, you can make changes to the page setup for the worksheet if you want. With Excel page setup, you can choose settings to scale the data to fit the page width, you can change the margins, or you can add page headers and footers. When you close print preview (or print the document), the worksheet generated by the OWCHelper ActiveX dll is displayed in Excel.

Additional Notes

If you prefer, you can incorporate script directly on your Web page that enables you to accomplish printing with Excel in much the same way as does the OWCHelper ActiveX DLL. However, because Microsoft Excel is an Automation server that is not marked safe, clients might receive a security warning when viewing your Web page. By using an ActiveX DLL to perform the Automation to Excel, you can avoid this warning.

The .cab file included with this download was packaged using the Package and Deployment Wizard that ships with Microsoft Visual Studio 6.0. It is marked Safe for Scripting and Safe for Initialization.

(c) Microsoft Corporation 2000, All Rights Reserved. Contributions by Dave Stearns, Microsoft Corporation.

↑ Back to the top


References

Programming Microsoft Office 2000 Web Components by Dave Stearns, ISBN 0-7356-0794-X

For more information about the Microsoft Office Web Components, please visit the following Microsoft Web site: For additional information about sample code that demonstrates solutions using the Office 2000 Web Components with VBScript and ASP, click the article number below to view the article in the Microsoft Knowledge Base:
258187� OWebComp.exe Contains Scripting Samples for the Office Web Components

↑ Back to the top


Keywords: KB262827, kbpivottable, kbofficewebpivot, kbfile, kbautomation, kbdownload

↑ Back to the top

Article Info
Article ID : 262827
Revision : 9
Created on : 8/23/2005
Published on : 8/23/2005
Exists online : False
Views : 272