The template engine can be invoked from the command line:
java net.sf.csutils.poi.Main -csUrl http://127.0.0.1:53305/CentraSite/CentraSite -csUser MyUsername -csPassword MyPassword -inputFile SomeFile.txt -outputFile AnotherFile.xls -spreadsheetFile XlsTemplate.xlt
This example would read a data template from SomeFile.txt, process it, and write the output to AnotherFile.xls. (Of course, you've got to enter the complete command as a single line.)
Options are introduced by one or two dashs, like this:
-csUrl http://127.0.0.1:53305/CentraSite/CentraSite --csUrl http://127.0.0.1:53305/CentraSite/CentraSite
It doesn't matter, which version you choose. The following options are available in the command line interface:
Option name | Description |
---|---|
csPassword | Sets the CentraSite password. Example: -csPassword MyPassword |
csUrl | Sets the CentraSite URL. Example: -csUrl http://127.0.0.1:53305/CentraSite/CentraSite |
csUser | Sets the CentraSite user name. Example: -csUser MyDomain\MyUsername |
help | Prints the usage description and exits with error status. Example: -help |
inputEncoding | Sets the input templates encoding; defaults to UTF8. Example: -inputEncoding CP-1252 |
inputFile | Sets the input file, this option is mutually exclusive with inputUrl. Example: -inputFile MyFile.xml |
inputUrl | Sets the input URL, this option is mutually exclusive with inputFile. Example: -inputURL http://127.0.0.1/MyFile.xml |
outputFile | Sets the output file. Example: -outputFile OtherFile.xls |
spreadsheetFile | Sets the name of a spreadsheet, which is being read as an Excel template. Typically, this file will contain formulas, style definitions, macros, and so on, which operate on the data that is being filled into the file. Example: -spreadsheetFile MyFile.xls This option is mutually exclusive with spreadsheetUrl. |
spreadsheetType | Sets spreadsheet type, either of xls (default), or xlsx (Office Open XML). Example: -spreadsheetType xslx |
spreadsheetUrl | Sets the URL of a spreadsheet, which is being read as an Excel template. Typically, this file will contain formulas, style definitions, macros, and so on, which operate on the data that is being filled into the file. Example: -spreadsheetFile MyFile.xls This option is mutually exclusive with spreadsheetFile. |