Page tree

Versions Compared

Key

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

...

Csharp
1
1
using SoftArtisans.OfficeWriter.ExcelWriter;
Vbnet
1
1

Imports SoftArtisans.OfficeWriter.ExcelWriter

...

Csharp
2
2
ExcelTemplate oXLT = new ExcelTemplate();
Vbnet
2
2

Dim oXLT As New ExcelTemplate()

...

Csharp
3
3
oXLT.Open(Page.MapPath("templates\\Hello World.xlsx"));
Vbnet
3
3

oXLT.Open(Page.MapPath("templates\Hello World.xlsx"))

...

Csharp
4
4
DataBindingProperties oDataProps = oXLT.CreateDataBindingProperties();
Vbnet
4
4

Dim oDataProps As DataBindingProperties = oXLT.CreateDataBindingProperties()

...

Csharp
5
5
string value = DataValueBox.Text.Trim();
oXLT.BindCellData(value, "DataValue", oDataProps);
Vbnet
5
5

Dim value As String = DataValueBox.Text.Trim()
oXLT.BindCellData(value, "DataValue", oDataProps)

...

Csharp
6
6
oXLT.Process();
Vbnet
6
6

oXLT.Process()

ExcelTemplate.Process() handles everything relating to inserting the data into the file. If we were importing multiple rows of data, Process() would handle inserting the new physical rows into the Excel worksheet.

...

Csharp
7
7
oXLT.Save(Page.Response, "Output.xlsx", false);
Vbnet
7
7

oXLT.Save(Page.Response, "Output.xlsx", False)

...

Csharp
8
8

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);

Vbnet
8
8

Imports SoftArtisans.OfficeWriter.ExcelWriter
...
Dim oXLT As New ExcelTemplate()
oXLT.Open(Page.MapPath("templates\Hello World.xlsx"))
Dim oDataProps As DataBindingProperties = oXLT.CreateDataBindingProperties()
Dim value As String = DataValueBox.Text.Trim()
oXLT.BindCellData(value, "DataValue", oDataProps)
oXLT.Process()
oXLT.Save(Page.Response, "Output.xlsx", False)