Home     Products      Support      Corporate     Sign In 
Support Knowledge Base, Article 519
Product
ExcelWriter
Title
Access ExcelWriter from a remote machine using a .Net Web Service
Problem
Companies may wish to run ExcelWriter from an application server rather than installing and running it on a web server.
Solution
Attached is a basic VisualStudio.NET solution, written in C#, that calls ExcelWriter via the web service: "ExcelWriterService." ExcelWriter is installed as a traditional COM object on the server hosting the web service. This web service contains the web method GetSpreadSheet which accepts a DataSet as input and returns an array of bytes constituting the Excel workbook.

The attached project includes:
  1. ExcelWriterService.cs -- This is a .NET web service that populates a workbook using ExcelWriter through interop. The spreadsheet is returned to the client as an array of bytes. Please note that the default .NET implementation uses base64 encoding to send the array of bytes this is a bit of unnecessary overhead, but it fits cleanly into .NET code.
  2. ExcelWriterService.asmx --This is simply the web service page that calls into implementation in the .cs file.
  3. ExcelWriterWsProxy.cs --This is the client of ExcelWriterService. It was generated with the .NET command-line tool 'wsdl.exe'. The command line call was:
         C:\>wsdl /language:C# /namespace:SoftArtisans.ExcelWriter /out:ExcelWriterWsProxy.cs /protocol:SOAP http://localhost/xlwws/ExcelWriterService.asmx?wsdl
  4. GetSpreadsheet.aspx -- This is the ASP.NET page that uses the web service proxy in 'ExcelWriterWsProxy.cs' to call the web service and stream the spreadsheet to the users browser.
Related Links
OfficeWriter Home Page
OfficeWriter Enterprise Edition
Latest OfficeWriter News
OfficeWriter: Programmatic Runtime Control

Attachments
Attachments/KB519_XLW_WebService.zip
Created : 12/1/2002 12:00:00 AM (last modified : 12/4/2002 6:21:05 PM)
Rate this article!
 
Comments