Page tree

Versions Compared

Key

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

...

Note

This example assumes an understanding of ExcelTemplate. If you are not familiar with how to set up an Excel template with data markers, please go through the Simple Expense Summary first.

Using Modifiers

Warning

I would have probably started with a template that has static, fully-named data markers (with screen shot). User should be provided with a copy of the static template. Then slowly make the page more dynamic by switching in the ordinal syntax for the columns of data and the column headers. Then add the field name modifier to the column headers. After that, switch to the header and show off the optional modifier. Provide the user with a screen shot of the completed template.

Here is the starting template:
The next few steps will demonstrate adding modifiers. 

...

The optional modifier allows that data marker to be ignored on data binding. The optional modifier allows you to bind data if the column might be empty. It is used like this:

Warning

The optional modifier allows the data marker to be ignored if there is no data corresponding with that column. << This should be the first thing covered. Saying that the marker will be ignored is misleading because it sounds like it will be ignored or removed all the time. Also, it is important to note that the physical columns will still be there - ExcelWriter doesn't remove the extra cells.

After the modifiers are added, the template should resemble this:

Warning

Move to part 2

Conditional Formatting

ExcelTemplate will persist conditional formatting in a template. In this tutorial, conditional formatting is applied to the "Other" table. It sets negative numbers to be red and bold.

...

Without the post processing, the populated file will persist the column width and heights. It should look something like this:

Warning

Move to part 3 with the rest of ExcelApplication. Mixing and matching too much doesn't make sense.

Post-Processing

1. In the post-processing method, instantiate the ExcelApplication object:

...