Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

There are several steps to make OfficeWriter available to your .NET applications:

  1. Install OfficeWriter
  2. Include System.Web
  3. Add references to OfficeWriter
  4. Include OfficeWriter in your code

Anchor
SystemWeb
SystemWeb
Add a reference to System.Web

All of the OfficeWriter API objects (ExcelTemplate, ExcelApplication, PowerPointTemplatePowerPointApplication,  WordTemplate, WordApplication) have the output options for saving to disk, saving to memory stream, streaming to user in a page response. The last output option, streaming to the user, has a dependency on System.Web. If you are developing a web application, the reference to System.Web should have been added automatically. For other types of applications, you may need to add this reference.

...

  1. At the top level of your application, create a directory call bin.
  2. Copy SoftArtisans.OfficeWriter.ExcelWriter.dll, SoftArtisans.OfficeWriter.PowerPointWriter.dll, or SoftArtisans.OfficeWriter.WordWriter.dll from the install directory to your application's bin directory.

...

  1. Right-click the project name in the Solution Explorer and choose Add Reference.
  2. Click Browse and navigate to C:\Program Files\SoftArtisans\OfficeWriter\bin.
  3. Choose Softartisans.OfficeWriter.ExcelWriter.dll or ,  SoftArtisans.OfficeWriter.PowerPointWriter.dll, or SoftArtisans.OfficeWriter.WordWriter.dll and click Open.
  4. Click OK.

...

These instructions can be used for installing SoftArtisans.OfficeWriter.ExcelWriter.dll, SoftArtisans.OfficeWriter.PowerPointWriter.dll or SoftArtisans.OfficeWriter.WordWriter.dll in the GAC; remember to change 'ExcelWriter' to 'WordWriter' if you want to install SoftArtisans.OfficeWriter.WordWriter.dll instead of ExcelWriteror 'PowerPointWriter depending on the dll you wish to install:

  1. Open a command prompt window and move to the directory OfficeWriter\bin\dotnet20\.
  2. Enter gacutil /i SoftArtisans.OfficeWriter.ExcelWriter.dll.
  3. Open the file machine.config (in [Windows directory]\Microsoft.NET\Framework[.NET version directory]\CONFIG).

...

Code Block
using SoftArtisans.OfficeWriter.ExcelWriter; //For ExcelWriter
using SoftArtisans.OfficeWriter.WordWriter; //For WordWriter

using SoftArtisans.OfficeWriter.PowerPointWriter; //For PowerPointWriter

As mentioned above, you will also need to make sure that System.Web is included in your project.