Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{div:class=kate-style}
ExcelWriter offers two approaches to generating, processing and manipulating Excel documents: ExcelTemplate and ExcelApplication. This tutorial will walk you through assigning the contents of a cell using ExcelTemplate and ExcelApplication.

[Download the Hello, World sample code]

{info}You will need ExcelWriter 8 installed in order to run the _Hello, World_ sample. 
* If you haven't purchased ExcelWriter, you can download an evaluation version [here].
* If you need to install ExcelWriter, please visit the [install page| Docs:Installing OfficeWriter] for instructions.{info}

h3. Getting started with ExcelWriter in .NET

After ExcelWriter is installed, the next step is to create a .NET project and add a reference to the ExcelWriter library. These steps have already been done for you in the Hello, World sample. 

# Open Visual Studio and create a .NET project (this tutorial uses a web application). 
# Add a reference to SoftArtisans.OfficeWriter.ExcelWriter.dll
#* SoftArtisans.OfficeWriter.ExcelWriter.dll is located under *Program Files > SoftArtisans > OfficeWriter > bin* 


h3. Hello World with ExcelTemplate

ExcelWriter's ExcelTemplate approach allows you to write data to a template file that contains data markers. The data markers tell ExcelWriter where to bind specific sets of data. This tutorial will show you the basics on how to dynamically insert data into a worksheet using ExcelTemplate. 


h5. Setting up the template file

InThe the template file for Hello, World can be found under *{{\templates\Hello World.xlsx}}*.  

We are going to bind a single string value to a cell in a template file. thereTo is a do this, we will first need to add a data marker to the cell where we want the value to appear. 

We've already added the single data marker {{%%=$DataValue}} to the {{Hello World.xlsx}} template file. All ExcelWriter data markers are prefaced with {{%%=}} and the {{$}} sign means that the data source for this data marker is 1-dimensional (e.g. 1-dimensional array or single value). {{DataValue}} is the data marker ID we'll  use to bind the data to this data marker.  
New
toSCREEN dataSHOT markers?
Check
outNow ourthe [datatemplate markers guide]file is done. Next is SCREENwriting SHOTthe code to Thebind templatethe filestring forvalue Hello,to Worldthe candata bemarker. found
under
*{{\templates\Hello World.xlsx}}*.
h5. 
This section refers h5.to Writing the code-behind for the ExcelTemplate Hello, World sample: {{ExcelTemplate_HelloWorld.aspx.cs}}. 



h3. Hello World with ExcelApplication

h3. Next Steps

*[Tutorials]*
{excerpt-include:Tutorials|nopanel=true}

*[API Reference]*
{excerpt-include:Programmer's API Reference|nopanel=true}

*[Help]*
{excerpt-include:Help|nopanel=true}

{div}