ExcelAppenderUnit
Class name |
com.ebd.hub.datawizard.iu.ExcelAppenderUnit |
Important note: Please use encoding "8859_1" in Responses that use the output of this Integration Unit.
This Integration Unit uses an existing Excel file as a template and fills it with values of the target tree. Important note: The Integration Unit supports only .xlt, .xls or .xlsx template files. Other Excel file formats are not supported. The output files are in the same format and the template file itself is not modified. To create the output Excel file, use a Response of type "File" and set the "Content" to "Output of IU". And then simply use file name "table.xls", for example.
If a String or a Blob value in the target tree starts with "Formula:", for example "Formula:=SUM(A1,A3)", the formula will be inserted into the Excel cell. A list of supported Excel functions can be found in the section below.
The Integration Unit expects the filename and path of an Excel template file, the line, after which the data should be inserted, and the start column.
The parameter Excel password for protection can prevent subsequent changes to the Excel file. With parameter Remove all formulars, all formulas can be deleted after the calculation (if the partner should not see them).
The creation of multiple sheets is described below in a separate section.
Parameters
Parameter name |
Allowed values |
Default value |
Description |
Append data after row |
|
1 |
Row number, after which the data is to be inserted. |
Enable dynamic sheet handling |
true, false |
false |
See section 'Multiple Sheets' below. |
Excel password for protection |
|
|
Password for the Excel file. Which Excel attributes are set is described in the section below. Note: See also parameter Protect to open file - needs password. |
Excel password to open file |
|
|
Password to open the Excel file. |
Excel template file |
|
|
File name and path of the Excel template file. |
Export as XML |
true, false |
false |
Creates the Excel file in the Microsoft XML format SpreadsheetML . Note: Set the content to "Output of IU" and the encoding to "8859_1" in the Response. |
Force style |
true, false |
false |
See parameter "Use style of row". |
Ignore new line in cell data |
true, false |
false |
If true, linebreaks (NL) in cells are ignored. |
Newly created sheet(s) are based on sheet# |
|
0 |
See section "Multiple Sheets" below. |
One sheet for each record |
true, false |
false |
Creates one sheet for each record. |
Remove all empty rows at end of each worksheet |
true, false |
false |
Removes all empty rows at the end of each worksheet. |
Remove all formulas |
true, false |
false |
Removes all formulas after calculations have been done (e.g. because a partner should not see them). |
Replace variable filler |
true, false |
false |
Replaces variable fillers {var_myVariable} in the template file. |
Sheet names (use semicolon to delimit names) |
|
1 |
Name of spreadsheets if the option Use multiple sheets is used. |
Skip empty fields |
true, false |
false |
Cells in Excel are not 'touched' if the target structure field's Empty Flag is set. That is, for example, no empty string is written (necessary if a cell has a formula that should not be overwritten). |
Start at column |
|
1 |
Column number, after which the data is to be inserted. |
Use multiple sheets |
true, false |
false |
If the optional parameter Use multiple sheets is configured with value true, multiple spreadsheets can be generated. For that purpose, a target node can be associated with a spreadsheet by setting the node attribute "Optional Settings" to the number of the corresponding spreadsheet. Only integer values, starting with 1, are allowed. |
Use style of row |
|
0 |
The format of the specified row of the template file is used as format for the newly created rows. If the format is to be adopted in general (not only for new lines), you can use parameter Force style. 0 = no template. |
Multiple sheets
Please note that parameter One sheet for each record=true beats all options shown here.
Optional settings
Assumption: The template file (.xlsx) has four sheets for the four quarters with names: QI,QII,QIII,QIV.
If you want to write into the third sheet (QIII), the following parameters and values have to be set:
Use multiple sheets = true
Sheet names (use semicolon to delim names) = QI;QII;QIII;QIV
The node that is supposed to write into sheet QIII needs to have value 3 in node attribute Optional Settings.
Parameter "Enable dynamic sheet handling"
In the first variant, several sheets are created based on fixed values in the node attribute Optional Settings. However, it is also possible to create several sheets based on dynamic values.
Parameter Enable dynamic sheet handling must be set to true.
The variable VAR_MAX_EXCEL_SHEETS of type Integer must be defined, which contains the maximum number of sheets that may be created.
If a field FLD_EXCEL_SHEET (or FLD_EXCEL_SHEET#2) is defined in a node, the integer value of the field is used as sheet number, otherwise the Optional Settings value of the node applies. If several fields starting with FLD_EXCEL_SHEET are defined in a node, the first field is used.
If the content of a sheet defined in the template is to be copied for newly created sheets (i.e. those that do not exist in the template), parameter Newly created sheet(s) are based on sheet# can be used. If the specified sheet number is smaller than 1, nothing is copied. The same applies if the sheet number is greater than the number of existing sheets (in the template).
Supported Excel functions
A |
ABS, ACCRINT, ACCRINTM, ACOS, ACOSH, ADDRESS, AMORDEGRC, AMORLINC, AND, AREAS, ASIN, ASINH, ATAN, ATAN2, ATANH, AVEDEV, AVERAGE, AVERAGEA, AVERAGEIF |
B |
BESSELI, BESSELJ, BESSELK, BESSELY, BETADIST, BETAINV, BIN2DEC, BIN2HEX, BIN2OCT, BINOMDIST |
C |
CEILING, CHAR, CHIDIST, CHIINV, CHITEST, CHOOSE, CODE, COLUMN, COLUMNS, COMBIN, CONCATENATE, CONFIDENCE, CORREL, COS, COSH, COUNT, COUNTA, COUNTBLANK, COUNTIF, COUPDAYBS, COUPDAYS, COUPDAYSNC, COUPNCD, COUPNUM, COUPPCD, COVAR, CRITBINOM, CUMIPMT, CUMPRINC |
D |
DATE, DATEDIF, DATEVALUE, DAY, DAYS360, DAVERAGE, DB, DCOUNT, DCOUNTA, DDB, DEC2BIN, DEC2HEX, DEC2OCT, DEGREES, DELTA, DEVSQ, DGET, DISC, DMAX, DMIN, DOLLAR, DOLLARDE, DOLLARFR, DPRODUCT, DSTDEV, DSTDEVP, DSUM, DURATION, DVAR, DVARP |
E |
EDATE, EFFECT, EOMONTH, ERF, ERFC, ERROR.TYPE, EVEN, EXACT, EXP, EXPONDIST |
F |
F.DIST, F.DIST.RT, F.INV.RT, FACT, FACTDOUBLE, FDIST, FIND, FINDB, FINV, FISHER, FISHERINV, FIXED, FLOOR, FORECAST, FORMULATEXT, FREQUENCY, FV, FVSCHEDULE, FALSE |
G |
GAMMADIST, GAMMAINV, GAMMALN, GCD, GEOMEAN, GESTEP, GROWTH |
H |
HARMEAN, HLOOKUP, HOUR, HYPGEOMDIST, HYPERLINK |
I |
IF, IFERROR, IMABS, IMAGINARY , IMARGUMENT, IMCONJUGATE, IMCOS, IMDIV, IMEXP, IMLN, IMLOG10, IMLOG2, IMPOWER, IMPRODUCT, IMREAL, IMSIN, IMSQRT, IMSUB, IMSUM, INDEX, INDIRECT, INT, INTERCEPT, INTRATE, IPMT, ISBLANK, ISERR, ISERROR, ISEVEN, ISLOGICAL, ISNA, ISNONTEXT, ISNUMBER, ISODD, ISPMT, ISREF, ISTEXT |
K |
KURT |
L |
LARGE, LCM, LEFT, LEFTB, LEN, LENB, LINEST, LN, LOG, LOG10, LOGEST, LOGINV, LOGNORMDIST, LOOKUP, LOWER |
M |
MATCH, MAX, MAXA, MDETERM, MDURATION, MEDIAN, MID, MIDB, MIN, MINA, MINUTE, MINVERSE, MIRR, MMULT, MOD, MODE, MONTH, MROUND, MULTINOMIAL |
N |
N, NA, NEGBINOMDIST, NETWORKDAYS, NOMINAL, NORMDIST, NORMINV, NORMSDIST, NORMSINV, NOT, NOW, NPER, NPV |
O |
OCT2BIN, OCT2DEC, OCT2HEX, ODD, ODDFPRICE, ODDLPRICE, ODDLYIELD, OFFSET, OR |
P |
PEARSON, PERCENTILE, PERCENTRANK, PERMUT, PI, PMT, POISSON, POWER, PPMT, PRICE, PRICEDISC, PRICEMAT, PROB, PRODUCT, PROPER, PV |
Q |
QUARTILE, QUOTIENT |
R |
RADIANS, RAND, RANDBETWEEN, RANK, RATE, RECEIVED, REPLACE, REPLACEB, REPT, RIGHT, RIGHTB, ROUND, ROUNDDOWN, ROUNDUP, ROW, ROWS, RSQ |
S |
SEARCH, SEARCHB, SECOND, SERIESSUM, SIGN, SIN, SINH, SKEW, SLN, SLOPE, SMALL, SQRT, SQRTPI, STANDARDIZE, STDEV, STDEVA, STDEVP, STDEVPA, STEYX, SUBSTITUTE, SUBTOTAL, SUM, SUMIF, SUMPRODUCT, SUMSQ, SUMX2MY2, SUMX2PY2, SUMXMY2, SYD |
T |
T, TAN, TANH, TBILLEQ, TBILLPRICE, TBILLYIELD, TDIST, TEXT, TIME, TIMEVALUE, TINV, TODAY, TREND, TRIM, TRIMMEAN, TRUE, TRUNC, TTEST, TYPE |
U |
UPPER, USDOLLAR |
V |
VALUE, VAR, VARA, VARP, VARPA, VDB, VLOOKUP |
W |
WEEKDAY, WEEKNUM, WEIBULL, WORKDAY |
X |
XIRR, XNPV |
Y |
YEAR, YEARFRAC, YIELD, YIELDDISC, YIELDMAT |
Z |
ZTEST |
Excel password protection attributes
Attribute |
Value |
Select locked cells |
true |
Select unlocked cells |
true |
Format cells |
true |
Format rows |
true |
Insert columns |
false |
Insert rows |
false |
Insert hyperlinks |
false |
Delete columns |
false |
Delete rows |
false |
Sort |
true |
Use AutoFilter |
true |
Use PivotTable reports |
true |
Edit objects |
false |
Edit scenarios |
false |
Edit content |
false |