Solusi kita nyedhiyakake API independen platform sing kuat. Gunakake API dokumen Mail merge kanggo ngembangake piranti lunak tingkat dhuwur kanggo platform Java. Iki minangka solusi piranti lunak sing kuat kanggo nggabungake template ing Word format lan PDF lan data saka sumber data khusus lan luwih ngekspor asil menyang DOCX, PDF, HTML lan format populer liyane nggunakake Java.
Pustaka Fast Java kanggo nglakokake gabungan Mail karo Excel data.
Mail Merge SDK ngidini sampeyan ngisi cithakan Word nganggo data saka Excel lembar. Adhedhasar Mail Merge API, sampeyan bisa nggawe solusi piranti lunak dhewe nggunakake Java, sing ngidini sampeyan ngotomatisasi email saka Excel lan ngasilake laporan nganggo Excel data.
Kanggo Mail merge saka Excel menyang Word, cukup nindakake operasi Mail merge ing Java lan ekspor asil menyang Word format sing didhukung.
Kanthi Mail merge API sing kuat, sampeyan bisa nggawe dokumen pribadi ing Java mung nggunakake cithakan Word Merge lan data saka Excel.
Cara nggunakake Mail merge saka Excel:
Kanthi Mail merge API kasetyan dhuwur, sampeyan uga bisa nindakake operasi Mail merge nganggo Google Docs. Cukup download data sing dibutuhake ing Word format lan Excel, priksa manawa template Word ngemot kolom gabungan lan nindakake operasi gabungan Mail ing Java, padha karo algoritma sing diterangake ing bagean sadurunge.
Kanggo nyoba alat web Mail merge sing kuat iki, muat cithakan Word kanthi kolom gabungan khusus lan data saka Excel sing diowahi kaya sing kasebut ing ndhuwur. Sawise mbukak kode, ekspor asil menyang format apa wae nggunakake Java.
Conto ing ngisor iki nuduhake carane nindakake operasi Mail merge kanggo ngasilake Word dokumen ing Java:
// Repository path: https://releases.aspose.com/java/repo/
// Maven, where 'ver' - Aspose.Words version number, for example, 24.4.
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words</artifactId>
<version>ver</version>
<classifier>jdk17</classifier>
</dependency>
Nyalin
// Repository path: https://releases.aspose.com/java/repo/
// Gradle, where 'ver' - Aspose.Words version number, for example, 24.4.
compile(group: 'com.aspose', name: 'aspose-words', version: 'ver', classifier: 'jdk17')
Nyalin
// Repository path: https://releases.aspose.com/java/repo/
// Ivy, where 'ver' - Aspose.Words version number, for example, 24.4.
<dependency org="com.aspose" name="aspose-words" rev="ver">
<artifact name="aspose-words" m:classifier="jdk17" ext="jar"/>
</dependency>
Nyalin
// Repository path: https://releases.aspose.com/java/repo/
// Sbt, where 'ver' - Aspose.Words version number, for example, 24.4.
libraryDependencies += "com.aspose" % "aspose-words" % "ver"
Nyalin
import com.aspose.words.*;
import com.aspose.cells.Workbook;
import com.aspose.cells.Worksheet;
Document doc = new Document("Input1.docx");
Workbook workbook = new Workbook("Input2.xlsx");
Worksheet worksheet = workbook.getWorksheets().get(0);
com.aspose.cells.Range dataRange = worksheet.getCells().getMaxDisplayRange();
Object dataTable[][] = worksheet.getCells().exportArray(
0, 0, dataRange.getRowCount(), dataRange.getColumnCount());
doc.getMailMerge().execute(ObjectToDataTable(dataTable));
doc.save("Output.docx");
private static DataTable ObjectToDataTable(Object[][] data) {
DataTable dataTable = new DataTable("CellsTable");
for (int i = 0; i < data[0].length; i++)
dataTable.getColumns().add(data[0][i].toString());
for (int i = 1; i < data.length; i++)
dataTable.getRows().add(data[i]);
return dataTable;
}
Kita dadi tuan rumah paket Java ing repositori Maven. 'Aspose.Words kanggo Java' JAR umum sing ngemot kode byte. Tututi pandhuan langkah demi langkah babagan carane nginstal ing lingkungan pangembang Java.
Java SE 7 Java sing luwih anyar didhukung. Kita uga nyedhiyakake paket kapisah kanggo Java SE 6 yen sampeyan wajib nggunakake JRE ketinggalan jaman iki.
Java kita lintas platform lan mbukak kabeh sistem operasi kanthi JVM, kalebu Microsoft Windows, Linux, macOS, Android lan iOS.
Kanggo informasi babagan katergantungan paket opsional, kayata JogAmp JOGL, Harfbuzz font Java Advanced Imaging JAI, waca Dokumentasi Produk.
Sampeyan bisa nindakake operasi Mail merge kanggo format file liyane: