Slå samman flera Excel-filer till en Excel-fil Denna REST API indikerar till merge
flera Excel filer till en Excel fil.
RSET API
Copy
POST http://api.aspose.cloud/v3.0/cells/merge
Begärans parametrar är:
Parameternamn
Typ
Sökväg/Frågesträng/HTTPBody
Beskrivning
fil
fil
formData
Fil att ladda upp
formatera
sträng
fråga
xlsx
mergeToOneSheet
booleskt
fråga
Falsk
DeOpenAPI-specifikation definierar ett allmänt tillgängligt programmeringsgränssnitt och låter dig utföra REST-interaktioner direkt från en webbläsare.
Du kan använda cURL kommandoradsverktyg för att enkelt komma åt Aspose.Cells webbtjänster. Följande exempel visar hur man ringer till Cloud API med cURL.
Cloud SDK-familj
Att använda en SDK är det bästa sättet att påskynda utvecklingen. En SDK tar hand om detaljer på låg nivå och låter dig fokusera på dina projektuppgifter. Vänligen kolla inGitHub-förråd för en komplett lista med Aspose.Cells Cloud SDK.
Följande kodexempel visar hur man ringer till Aspose.Cells webbtjänster med olika SDK:er:
C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Aspose.Cells.Cloud.SDK.Tests.Api.Example
{
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Aspose.Cells.Cloud.SDK.Request;
using System.Collections.Generic;
using Aspose.Cells.Cloud.SDK.Api;
using System;
using System.IO;
[TestClass]
public class CellsApiExample
{
string CellsCloudClientId ="....";//get from https://dashboard.aspose.cloud/#/applications
string CellsCloudClientSecret="...";//get from https://dashboard.aspose.cloud/#/applications
string localName = "assemblytest.xlsx";
string localName2 = "datasource.xlsx";
string localPath = "D:/TestData/CellsCloud";
[TestCategory("Cells")]
[TestMethod]
public void Example()
{
IDictionary<string, Stream> mapFiles = new Dictionary<string, Stream>();
mapFiles.Add(localName, File.OpenRead(localPath +"/"+ localName));
mapFiles.Add(localName2, File.OpenRead(localPath +"/"+ localName2));
PostMergeRequest request = new PostMergeRequest { File = mapFiles, format = "pdf", mergeToOneSheet = true };
cellsApi.PostMerge(request);
}
}
}
Java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(remoteFolder + AssemblyTestXlsx));
fileMap.put(DataSourceXlsx , new File(remoteFolder + DataSourceXlsx) );
PostMergeRequest request = new PostMergeRequest();
request.setFile(fileMap);
request.setFormat("png");
request.setMergeToOneSheet(false);
request.setPassword("");
request.setCheckExcelRestriction(false);
FileInfo response = api.postMerge(request);
} catch (ApiException e) {
e.printStackTrace();
}catch (IOException e) {
e.printStackTrace();
}
}
}
PHP
Ruby
Node.js
Android
Perl
Go
Python