'aspose mail merge layout not follow word template
I use aspose word, create a datatable, add column, and then mail merge with the word template. But I find in the output, the column width is very different from the word template (e.g. the last column "last date of duty"), why?
The code is as follows:
DataTable tableOrders = new DataTable("Orders");
tableOrders.getColumns().add("rank");
tableOrders.getColumns().add("staffNo");
tableOrders.getColumns().add("name");
tableOrders.getColumns().add("idNo");
tableOrders.getColumns().add("nature");
tableOrders.getColumns().add("effDate");
tableOrders.getColumns().add("b4effDate");
while(i.hasNext()) {
Object[] rs = (Object[]) i.next();
String rank = rs[0]==null?"":rs[0].toString();
String staffNo = rs[1]==null?"":rs[1].toString();
String name = rs[2]==null?"":rs[2].toString();
String id_no = rs[3]==null?"":rs[3].toString();
String nature = rs[4]==null?"":rs[4].toString();
String effDate = rs[5]==null?"":(new SimpleDateFormat("yyyy-MM-dd")).format(rs[5]);
String lastDutyDate = rs[6]==null?"":(new SimpleDateFormat("yyyy-MM-dd")).format(rs[6]);
// Create the orders table.
tableOrders.getRows().add(rank, staffNo, name, id_no, nature, effDate, lastDutyDate);
}
doc.getMailMerge().executeWithRegions(tableOrders);
doc.getMailMerge().execute(new String[] {"currentDate"}, new String[] {sdf2.format(new Date())});
Solution 1:[1]
browserAction.setBadgeText() is used to set toolbar icon text but it shows up to to 3 characters (used to be 4 before).
browser.browserAction.setBadgeText({text: '123'});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | erosman |

