With the IncludeSpreadsheet command, you can embed a spreadsheet into the assembled document. This uses Microsoft’s OLE technology, which means that when viewing the assembled document, the user can double click on the spreadsheet, which will open the spreadsheet in Excel and the user will then be able to edit the spreadsheet. The edited result is placed back into the document.
The command has the following syntax:
The values of the parameters are as follows:
- The name of the spreadsheet file.
- The width (in inches) which the spreadsheet image must occupy in the document.
- The height (in inches) of the spreadsheet image in the document.
- This is a “Size Adjuster”. This applies when the spreadsheet is opened for editing.
The 2nd, 3rd and 4th parameters are optional and the examples above are the default values. They will differ from one spreadsheet to another and normally require some trial-and-error to get right.
As with other Include/Insert commands in XpressDox, the IncludeSpreadsheet command is used when the name of the spreadsheet file is known at the time the template is authored.
InsertSpreadsheet can be used to construct the name of the spreadsheet file from data entered in the interview or from a data source. An example would be:
Here the data element DirectorCode contains a code for a director. Suppose that code in this example is “AB”, then the spreadsheet file that will be embedded will be the file ‘HourlyRatesForAB.xlsx’.