Page tree

Versions Compared

Key

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

...

Now the template file is done. Next is writing the code to bind the string value to the data marker.

Writing the code

// ExcelTemplate

Code Block
languagecsharp

using SoftArtisans.OfficeWriter.ExcelWriter;
ExcelTemplate oXLT = new ExcelTemplate();
oXLT.Open(Page.MapPath("Hello World.xlsx"));
DataBindingProperties oDataProps = oXLT.CreateDataBindingProperties();
string value = DataValueBox.Text.Trim();
oXLT.BindCellData(value, "DataValue", oDataProps);
oXLT.Process();
oXLT.Save(Page.Response, "Output.xlsx", false);

...