Skip to content

Preparing excel files

foglcz edited this page Apr 22, 2013 · 11 revisions

So in the beginning of everything there's a excel file. The Open XML is pretty complex, so it's easier just to create your excel file prior actual generation. You should prepare the excel file including all macros, printer settings etc., which you want to use in the final report. We will be picking everything one-by-one afterwards.

For the purposes of this documentation, we will be generating the same file as the one, that gets generated by the SDK.

Excel done. Now what?

Once you prepare your excel template, unzip it. Do not delete the excel file, as the process is quite sensitive - so you want to keep it around up until it gets fully generated by your system.

Navigate to unzipped folder, and you should see a directory structure. As the structure is quite large, we will list only files that interest us:

  • xl/drawings/drawing1.xml - only when you have added at least one image
  • xl/media/imageX.jpg - only when you have added at least one image
  • xl/printerSettings/printerSettings1.bin - only when you have defined printer settings - NOT page settings!
  • xl/theme/theme1.xml
  • xl/worksheets/sheet1.xml
  • xl/sharedStrings.xml
  • xl/styles.xml
  • xl/vbaProject.bin - only when you have macro-enabled workbook

You might not see

Navigation

  1. Preparing excel files
  2. Preparing the first output
  3. Putting plain data into excel sheet
  4. Appending images
  5. Creating multiple worksheets
  6. Printer settings
  7. Macro-enabled workbooks
  8. Wrapping up