Hi,
I would like to know if there’s a way to delete rows with 0 value after merging. I’m using general merge fields in my table, not merge region. Perhaps I just need to check the second column which is the ‘Count’ column. So, if any record in this column is 0, I would like to delete the whole row.
Thanks,
Raymon
Hi Laurentius,
class HandleMergeImageFieldFromBlob implements IFieldMergingCallback {
public void fieldMerging(FieldMergingArgs args) throws Exception {
if (args.getFieldName() == “myCountField” && args.getFieldValue().equals(0)) {
//Create document builder
DocumentBuilder builder = new DocumentBuilder(args.getDocument());
//Move cursor to field
builder.moveToField(args.getField(), true);
//If mergefield is placed in Table we should remove entire row
Row row = (Row) builder.getCurrentParagraph().getAncestor(NodeType.ROW);
if (row != null)
row.remove();
}
}<font color="RED"><b>public</b></font> <font color="RED"><b>void</b></font> imageFieldMerging<font color="BLUE"><b>(</b></font>ImageFieldMergingArgs e<font color="BLUE"><b>)</b></font> <font color="RED"><b>throws</b></font> Exception <font color="BLUE"><b>{</b></font> <font color="GREEN"><i>/* DO NOTHING */</i></font> <font color="BLUE"><b>}</b></font>
}
Hi Awais,
Is there any simpler code snippet to make it work? I’m using coldfusion to develop the program, so it’s kinda complicated for me to convert your code to coldfusion. I’m thinking about using bookmark to go to the table which I want to check. Something like this:
—>
Thanks,
Raymon
Hi
Laurentius,