Page tree

Versions Compared

Key

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

...

Panel
bgColor#FAFAFA
borderColor#DDD

Preprocessing refers to using the ExcelApplication object to modify an existing partial template file before passing the template file to ExcelTemplate for importing data.

Postprocessing refers to using the ExcelApplication object to modify a workbook that has already been populated with data.

Background

ExcelTemplate was designed for importing large amounts of data into Excel workbooks. ExcelApplication was designed for the purpose of creating more dynamic content, but as a consequence it is more memory intensive. ExcelTemplate, on the other hand, was designed for the purpose of importing large amounts of data, and much less memory is required per cell for an ExcelTemplate object. To improve To minimize the amount of memory that's being consumed when using ExcelApplication, we recommend:

  1. Create a partial template
  2. Use ExcelApplication to dynamically modify the template
  3. Use ExcelTemplate to import large amounts of data
  4. Only postprocess when you need to

...

An example of when preprocessing is not available is needing to combine combining multiple existing files into a single workbook. This is common when using OfficeWriter for Reporting Services because the only way to access the reports with ExcelApplication is after they have already been rendered with Reporting Services and are full of imported data.

In general, it's best to avoid post-processing because the larger a report is, the more memory ExcelApplication will consumeas a report with all of its imported data can be much larger than the original template file. This means that ExcelApplication may consume a much larger amount of memory compared to the same operation performed on the original template. There is more information on how to reduce memory usage in Best Practices with Large Reports.