Page tree

Versions Compared

Key

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

Excerpt

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

...

Section

...

Column

...

ExcelTemplate's BindData Method

width

...

50%
Panel
bgColorwhite
titleBGColor#EEE
titleExcelTemplate
borderColor#AAA
titleColor#666

ExcelTemplate uses ExcelTemplate.BindData, which inserts new rows when it inserts new data.

Column
width50%
Panel
bgColorwhite
titleBGColor#EEE
titleExcelApplication
borderColor#AAA
titleColor#666

ExcelApplication uses Worksheet.ImportData, which overwrites the contents of cells when it inserts new data.

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.

...

Before/After 'SUM' formula:

Before/After formula:

ExelApplication's ImportData Method

\
\

Worksheet.ImportData (ExcelApplication)

When data is imported into a worksheet using ExcelApplication's Worksheet.ImportData, ExcelWriter does NOT insert new rows: values and formulas are overwritten by the new values. Formulas referencing the cells with the new data are not updated and formatting is not applied to the cells containing the new values.

...