One of our users was complaining that the printing of some selected records takes very long to complete, user needs to print 4 out of 256 records...
The code we use to do this is:
- Code: Select all
var v_fs, v_form;
v_fs = forms.exp_poLinesHeatnrList.foundset.duplicateFoundSet();
for (var i = v_fs.getSize(); i > 0; i--) {
var v_rec = v_fs.getRecord(i);
if (!v_rec.checkbox) { //checkbox not checked
v_fs.omitRecord(i);
}
}
Doing it this way it takes about 21 seconds to omit the not selected record from v_fs ,
but when doing it like this:
- Code: Select all
var v_fs, v_form, v_arrSelected;
v_fs = forms.exp_poLinesHeatnrList.foundset.duplicateFoundSet();
v_fs.multiSelect = true;
v_arrSelected = new Array();
for (var i = 1 ; i <= v_fs.getSize(); i++) {
var v_rec = v_fs.getRecord(i);
if (v_rec.checkbox != 1) {//checkbox not checked
v_arrSelected.push(i);
}
}
v_fs.setSelectedIndexes(v_arrSelected);
v_fs.omitRecord();
The omit is done nearly instantaneously
regards,
Peter