Page tree

Versions Compared

Key

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

Introduction

...

Table of Contents

Table of Contents
maxLevel

...

3
Excerpt
hiddentrue

ExcelWriter interacts with existing Workbook content in two possible ways when importing data.

Introduction

There are two ways to insert rows of data using ExcelWriter:

ExcelTemplate.BindData

When data is imported into a template file that contains data markers with ExcelTemplate.BindData (API Reference), the following is true:

  • ExcelWriter inserts a brand new row for each row of data in the data source.
  • Content in the cells below the data markers will be pushed down as the new rows are added.
  • Styles and formatting in the data marker row will be copied for each new row.
  • Formulas that reference the data marker row will be updated to reflect the newly inserted rows.

For example, we start with a simple template file that contains data markers:

...

Here is the template after it has been populated with data:

Below is a break down of what was affected when the data was imported.

...


After the data is imported, these rows are moved from rows 4 and & 5, to rows 7 and & 8.

Formatting on the data marker row

...

Before/After 'SUM' formula:

Before/After formula:

\  \

 

Worksheet.ImportData

...

When data is imported into a worksheet using ExcelApplication's Worksheet.ImportData (API Reference), the following is true:

  • ExcelWriter does NOT insert new rows

...

  • .
  • Values and formulas

...

  • can overwritten by the new values.
  • Formulas referencing the cells with the new data are not updated

...

  • .
  • Formatting is not applied to the cells containing the new values.

For example, we take the same template, but remove the data markers:

...