Message-ID: <449962562.10149.1711714668500.JavaMail.web05$@web05>
Subject: Exported From Confluence
MIME-Version: 1.0
Content-Type: multipart/related;
boundary="----=_Part_10148_585866751.1711714668500"
------=_Part_10148_585866751.1711714668500
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Content-Location: file:///C:/exported.html
Makin=
g OfficeWriter available to your applications
There are several steps to make OfficeWriter available to your .NET appl=
ications:
- Install OfficeWriter
- Include =
System.Web
- Add refe=
rences to OfficeWriter
- Include Of=
ficeWriter in your code
Add a reference to System.Web
All of the OfficeWriter API objects (ExcelTemplate
, ExcelApplication
, WordTemplate
, WordApplication
) have the output options for saving to disk,=
saving to memory stream, streaming to user in a page response. The last ou=
tput option, streaming to the user, has a dependency on System.Web. If you are developing a web application, the reference to Syste=
m.Web
should have been added automatically. For other types of appli=
cations, you may need to add this reference.
If you are using Visual Studio .NET:
- Right-click the project name in the Solution Explorer and choose Add Re=
ference.
- Click System and locate System.Web
=20
=20
Icon=20
=20
If you are compiling against .NET 4.0, make sure to use the full profile=
. The default profile does not include System.Web
.
=20
=20
=20
Add a reference to OfficeWriter=
h2>
There are two ways to do this:
- Make OfficeWriter available to a single application
- Make OfficeWriter available for all applications on machine
Method #1: Adding OfficeWriter to a specific appl=
ication
- At the top level of your application, create a directory call b=
in.
- Copy SoftArtisans.OfficeWriter.ExcelWriter.dll or SoftArtisans.OfficeWr=
iter.WordWriter.dll from the install directory to your application's bin di=
rectory.
If you are using Visual Studio .NET:
- Right-click the project name in the Solution Explorer and choose Add Re=
ference.
- Click Browse and navigate to C:\Program Files\SoftArtisans\OfficeWriter=
\bin.
- Choose Softartisans.OfficeWriter.ExcelWriter.dll or SoftArtisans.Office=
Writer.WordWriter.dll and click Open.
- Click OK.
Method #2: Making OfficeWriter avai=
lable to all applications on a machine
Step 1: Install OfficeWriter in the Global A=
ssembly Cache (GAC)
These instructions can be used for installing SoftArtisans.OfficeWriter.=
ExcelWriter.dll or SoftArtisans.OfficeWriter.WordWriter.dll in the GAC; rem=
ember to change 'ExcelWriter' to 'WordWriter' if you want to install SoftAr=
tisans.OfficeWriter.WordWriter.dll instead of ExcelWriter:
- Open a command prompt window and move to the directory OfficeWriter\bin=
\dotnet20\.
- Enter gacutil /i SoftArtisans.OfficeWriter.ExcelWriter.dll.
- Open the file machine.config (in [Windows directory]\M=
icrosoft.NET\Framework[.NET version directory]\CONFIG).
Step 2: Reference the copy=
of OfficeWriter in the GAC in machine.config or web.config
Add the following line to the assemblies node of machin=
e.config:
=20
<add assembly=3D"Softartisans.OfficeWriter.ExcelWriter,
Version=3Dx.x.x.x, Culture=3Dneutral, PublicKeyToken=3Df593502a=
f6ee46ae"/>
=20
=20
=
=20
=20
You may need to add the assemblies parent node to machi=
ne.config under the configuration node.
=20
=20
=20
OR
Create a text file containing the following lines, and save it as web.config. Save web.config at the top level of your application=
.
=20
<?xml version=3D"1.0" encoding=3D"utf-8" ?&g=
t;
<configuration>
<system.web>
<compilation>
<compilers>
</compilers>
<assemblies>
<add assembly=3D"Softartisans.OfficeWriter.ExcelWri=
ter,
Version=3Dx.x.x.x,
Culture=3Dneutral,
PublicKeyToken=3Df593502af6ee46ae"/>
<add assembly=3D"*" />
</assemblies>
</compilation>
</system.web>
</configuration>
=20
=20
=
=20
=20
The version attribute of the add assembly node must correspond e=
xactly to the version of Softartisans.OfficeWriter.<Excel/Word&=
gt;Writer.dll added to the GAC. If you add a new version of Softartisans.Of=
ficeWriter.<Excel/Word>Writer.dll to the GAC using the gacutil comman=
d, update the dll version attributes in machine.config. To get the exact ve=
rsion of Softartisans.OfficeWriter.<Excel/Word>Writer.dll, right-clic=
k the file and select the Properties tab.
=20
=20
=20
Include OfficeWriter in your code
On any page that uses OfficeWriter, make sure to add the appropriate using statements:
=20
using SoftArtisans.OfficeWriter.ExcelWriter; //For ExcelWriter
using SoftArtisans.OfficeWriter.WordWriter; //For WordWriter
=20
As mentioned above, you will also need to make sure that System.We=
b
is included in your project.
------=_Part_10148_585866751.1711714668500--