Java API to merge multiple Excel files into a file.

Java library to merge multi Excel files into a file.

Use Cells Merge REST API to merge multiple Excel files into a file in Java. This professional solution merge multiple Excel files into a Microsoft Excel or OpenOffice Calc spreadsheet using Java.

Merge multiple Excel files into a file - Java REST API

API Request:
POST
https://api.aspose.cloud/v3.0/cells/merge

Merging multiple Excel files into a file is a complex task. Merging multiple Excel files into a file transitions is performed by our Java SDK while maintaining the source spreadsheet's main structural and logical content. Our Java library is a professional solution to merge multiple Excel files into a file online. This Cloud SDK gives Java developers powerful functionality and perfect API.

Code example in Java using REST API to merging multiple Excel files into a file

package com.aspose.cloud.cells.api;
import com.aspose.cloud.cells.client.*;
import com.aspose.cloud.cells.model.*;
import com.aspose.cloud.cells.request.*;
import java.io.IOException;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import java.io.File;
import java.util.HashMap;
public class Example {
private CellsApi api;
public Example(){
try {
api = new CellsApi(
System.getenv("CellsCloudClientId"),
System.getenv("CellsCloudClientSecret"),
"v3.0",
System.getenv("CellsCloudApiBaseUrl")
);
} catch (ApiException e) {
e.printStackTrace();
}
}
public void Run(){
try{
String remoteFolder = "TestData/In";
String AssemblyTestXlsx = "assemblytest.xlsx";
String DataSourceXlsx = "datasource.xlsx";
HashMap<String,File> fileMap = new HashMap<String,File>();
fileMap.put(AssemblyTestXlsx , new File("D:\\TestData\\" + AssemblyTestXlsx));
fileMap.put(DataSourceXlsx , new File("D:\\TestData\\" + DataSourceXlsx) );
PostMergeRequest request = new PostMergeRequest();
request.setFile(fileMap);
request.setFormat("png");
request.setMergeToOneSheet(true);
request.setPassword("");
request.setCheckExcelRestriction(true);
FilesResult response = api.postMerge(request);
} catch (ApiException e) {
e.printStackTrace();
}catch (IOException e) {
e.printStackTrace();
}
}
}


How to use Java API to merge


  1. Create an account at Dashboard to get free API quota & authorization details
  2. Initialize CellsApi with Client Id, Client Secret, Base URL & API version
  3. Call postMerge method to get the resultant stream


System Requirements


  1. Maven 2.2.0 or newer
  2. Java(TM) SE Runtime Environment