You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//To check whether the mapped field has null value.
233
-
if ((args.getFieldValue())==null) //|| args.getFieldValue().equals(DBNull.Value))
234
-
{
235
-
//Gets the unmerged field name.
236
-
String unmergedFieldName = args.getFieldName();
237
-
String ownerGroup = args.getGroupName();
238
-
//Sets error message for unmerged fields.
239
-
args.setFieldValue("Error! The value of MergeField " + unmergedFieldName + " of owner group " + ownerGroup + " is defined as Null in the data source.");
240
-
}
241
-
else
242
-
//If field value is empty, you can set whether the unmerged merge field can be clear or not.
243
-
args.setClearField(true);
244
-
}
245
-
else
246
-
{
247
-
String unmergedFieldName = args.getFieldName();
248
-
//Sets error message for unmerged fields, which is not found in data source.
249
-
args.setFieldValue("Error! The value of MergeField " + unmergedFieldName + " is not found in the data source.");
250
-
}
251
-
}
252
-
{% endhighlight %}
253
-
254
-
{% endtabs %}
255
-
256
-
The following code example shows getDataTable method which is used to get data for mail merge.
Copy file name to clipboardExpand all lines: java-file-formats/word-library/mail-merge/mail-merge-options.md
-21Lines changed: 0 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -556,24 +556,3 @@ document.close();
556
556
{% endhighlight %}
557
557
558
558
{% endtabs %}
559
-
560
-
## Change mail merge data source path
561
-
562
-
You can change the linked **data source file path from a Word mail merge main document**, which is used for mail merge process by Microsoft Word application.
563
-
564
-
The following code example shows how to change the data source file path in the template Word document.
565
-
566
-
{% tabs %}
567
-
568
-
{% highlight JAVA %}
569
-
//Opens the template document.
570
-
WordDocument document = new WordDocument("Template.docx", FormatType.Docx);
Copy file name to clipboardExpand all lines: java-file-formats/word-library/working-with-mail-merge.md
+1-7Lines changed: 1 addition & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
---
1
+
---
2
2
title: Working with Mail merge | Syncfusion
3
3
description: This section illustrates about Mail merge Word document to create reports (letters, envelopes, labels, invoice, payroll) without MS Word or Office interop.
4
4
platform: java-file-formats
@@ -111,8 +111,6 @@ The `MailMerge` class provides event support to customize the document contents
111
111
112
112
*`MergeImageField`: Occurs when an **image Mail merge field** is encountered.
113
113
114
-
*`BeforeClearField`: Occurs when an **unmerged field** is encountered.
115
-
116
114
*`BeforeClearGroupField`: Occurs when an **unmerged group field** is encountered.
117
115
118
116
### MergeField event
@@ -123,10 +121,6 @@ You can customize the merging text during Mail merge process by using the `Merge
123
121
124
122
You can customize the merging image during Mail merge process by using the `MergeImageField` event. For further information, click [here](https://help.syncfusion.com/java-file-formats/word-library/mail-merge/mail-merge-events#mergeimagefield-event).
125
123
126
-
### BeforeClearField event
127
-
128
-
You can get the unmerged fields during Mail merge process by using the `BeforeClearField` event. For further information, click [here](https://help.syncfusion.com/java-file-formats/word-library/mail-merge/mail-merge-events#beforeclearfield-event).
129
-
130
124
### BeforeClearGroupField event
131
125
132
126
You can get the unmerged groups during Mail merge process by using the `BeforeClearGroupField` event. For further information, click [here](https://help.syncfusion.com/java-file-formats/word-library/mail-merge/mail-merge-events#beforecleargroupfield-event).
0 commit comments