Page tree

Versions Compared

Key

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

There are two ways to insert rows of data using ExcelWriter: ExcelTemplate's ExcelTemplate.BindData method and ExcelApplication's Worksheet.ImportData method.

ExcelTemplate.BindData

When data is imported into a template file that contains data markers with ExcelTemplate.BindData, 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:

Some things to note:

  • There is content below the data marker row (Grand Total row and a blue footer). This will be pushed down as new rows are inserted.

Before
After

  • There are two formulas
    • B4 contains a formula that references a data marker cell.
    • C3 contains a formula that references

Before
After

  • The italic and red font formatting will be applied for each row of data that is imported

Before
After

Worksheet.ImportData

How does ExcelWriter create rows when inserting data?

...