koen
June 6, 2017, 5:35am
1
Hi,
I’m struggeling to find out what the best way is to place different letters in one layout.
I have one printfile which have 200+ different letters as output.
I found a way through snippets, but is it also possible with variable sections?
I want to keep a clear overview of all the different letters.
In snippets I saw that for example the date variable won’t work, is this a bug?
koen
June 6, 2017, 7:58am
2
I found a solution in this topic:
Is there an easier way to turn off all the sections at once in the beginning of the script?
// Simple approach to initially disable output for the Print sections
merge.template.contexts.PRINT.sections['Section 1'].enabled = false;
merge.template.contexts.PRINT.sections['Section 2'].enabled = false;
// Enable a print section based on the value of a data field
if(record.fields['flag'] == 'V1') {
merge.template.contexts.PRINT.sections['Section 1'].enabled = true;
} else if (record.fields['flag'] == 'V2') {
merge.template.contexts.PRINT.sections['Section 2'].enabled = true;
}
just create a new control script and use a loop to disable all print sections:
var printSections = merge.template.contexts.PRINT.sections;
for (var i = 0; i < printSections.length; i++) {
printSections[i].enabled = false;
}
koen
June 6, 2017, 8:28am
4
Thanks! this works great for me!