Split remote spreadsheet Excel API : SplitRemoteSpreadsheet
Split a spreadsheet in cloud storage into the specified format, multi-file.
Interface Details
Endpoint
Copy PUT http://api .aspose.cloud/v4.0 /cells/{name} /split /spreadsheet
Function Description
This method splits a single spreadsheet file stored in cloud storage into multiple output files in the specified format (e.g., XLSX, CSV, PDF).Each split file may represent different sheets, sections, or segments of the original document based on user-defined criteria.The operation is performed remotely within the cloud environment, eliminating the need to download the files to the local machine.Ensure that you have valid cloud storage credentials and accessible file paths or identifiers for all input files.If the source file cannot be accessed, permissions are insufficient, or if an error occurs during the splitting process, an appropriate exception will be thrown.Supported formats for output depend on the capabilities of the underlying cloud processing service. Users should specify clear criteria for how the input file should be divided to ensure accurate results.
The request parameters of splitRemoteSpreadsheet API are:
Parameter Name
Type
Path/Query String/HTTPBody
Description
name
String
Path
The name of the workbook file to be split.
folder
String
Query
The folder path where the workbook is stored.
from
Integer
Query
Begin worksheet index.
to
Integer
Query
End worksheet index.
outFormat
String
Query
The desired output format (e.g., “Xlsx”, “Pdf”, “Csv”).
storageName
String
Query
(Optional) The name of the storage if using custom cloud storage. Use default storage if omitted.
outPath
String
Query
(Optional) The folder path where the workbook is stored. The default is null.
outStorageName
String
Query
Output file Storage Name.
fontsLocation
String
Query
Use Custom fonts.
regoin
String
Query
The spreadsheet region setting.
password
String
Query
The password for opening spreadsheet file.
Response Description
OpenAPI Specification
The OpenAPI Specification defines a publicly accessible programming interface and lets you carry out REST interactions directly from a web browser.
Excel API SDK
Using an SDK is the best way to speed up the development. An SDK takes care of low-level details and lets you focus on your project tasks. Please check out the GitHub repository for a complete list of Aspose.Cells Cloud SDKs.
The following code examples demonstrate how to make calls to Aspose.Cells web services using various SDKs:
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
using Aspose.Cells.Cloud.SDK.Api;
using Aspose.Cells.Cloud.SDK.Model;
using Aspose.Cells.Cloud.SDK.Request;
using System;
using System.IO;
using System.Collections.Generic;
using Range = Aspose.Cells.Cloud.SDK.Model.Range;
public static class Example40_SplitFileInRemote
{
public static void Run()
{
CellsApi cellsApi = new CellsApi("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
string remoteFolder = "TestData/In";
string book1Xlsx = "Book1.xlsx";
string outFormat = "PDF";
var request = new SplitRemoteSpreadsheetRequest(
name: book1Xlsx,
folder: remoteFolder,
outFormat: outFormat,
outPath: "TestData/Out"
);
cellsApi.SplitRemoteSpreadsheet(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 org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import java.io.File;
import java.util.HashMap;
public class ExampleSplitRemoteSpreadsheet {
private CellsApi api;
public ExampleSplitRemoteSpreadsheet(){
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 book1Xlsx = "Book1.xlsx";
String outFormat = "PDF";
SplitRemoteSpreadsheetRequest request = new SplitRemoteSpreadsheetRequest();
request.setName(book1Xlsx);
request.setOutFormat(outFormat);
request.setFolder(remoteFolder);
request.setOutPath("TestData/Out");
this.api.splitRemoteSpreadsheet(request);
} catch (ApiException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
PHP
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
<?php
require_once('vendor\autoload.php');
use \Aspose\Cells\Cloud\Api\CellsApi;
use \Aspose\Cells\Cloud\Request\SplitRemoteSpreadsheetRequest;
$cellsApi = new CellsApi(getenv("CellsCloudClientId"),getenv("CellsCloudClientSecret"),"v3.0",getenv("CellsCloudApiBaseUrl"));
$remoteFolder = "TestData/In";
$book1Xlsx = "Book1.xlsx";
$outFormat = "PDF";
$request = new SplitRemoteSpreadsheetRequest();
$request->setName( $book1Xlsx);
$request->setFolder( $remoteFolder);
$request->setOutFormat( $outFormat);
$request->setOutPath( "TestData/Out");
$$cellsApi->splitRemoteSpreadsheet($request);
Ruby
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
require 'openssl'
require 'bundler'
require 'aspose_cells_cloud'
@instance = AsposeCellsCloud::CellsApi.new(ENV['CellsCloudClientId'], ENV['CellsCloudClientSecret'],'v3.0',ENV['CellsCloudApiBaseUrl'])
remote_folder = 'TestData/In'
book1_xlsx = 'Book1.xlsx'
out_format = 'PDF'
request = AsposeCellsCloud::SplitRemoteSpreadsheetRequest.new(:name=>book1_xlsx,:folder=>remote_folder,:outFormat=>out_format,:outPath=>'TestData/Out');
@instance.split_remote_spreadsheet(request);
Node.js
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
var fs = require('fs');
var path = require('path');
const _ = require('asposecellscloud');
const cellsApi = new CellsApi(process.env.CellsCloudClientId, process.env.CellsCloudClientSecret,"v3.0",process.env.CellsCloudApiBaseUrl);
var remoteFolder = "TestData/In"
var book1Xlsx = "Book1.xlsx"
var outFormat = "PDF"
var request = new model.SplitRemoteSpreadsheetRequest();
request.name = book1Xlsx;
request.folder = remoteFolder;
request.outFormat = outFormat;
request.outPath = "TestData/Out";
return cellsApi.splitRemoteSpreadsheet(request).then((result) => {
expect(result.response.statusCode).to.equal(200);
});
Python
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
import os
import sys
from asposecellscloud.apis.cells_api import CellsApi
from asposecellscloud.models import *
from asposecellscloud.requests import *
api = CellsApi(os.getenv('CellsCloudClientId'),os.getenv('CellsCloudClientSecret'),"v3.0",os.getenv('CellsCloudApiBaseUrl'))
remote_folder = 'TestData/In'
book1_xlsx = 'Book1.xlsx'
out_format = 'PDF'
request = SplitRemoteSpreadsheetRequest( book1_xlsx,folder= remote_folder,out_format= out_format,out_path= 'TestData/Out')
api.split_remote_spreadsheet(request)
Perl
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
use lib 'lib';
use strict;
use warnings;
use File::Slurp;
use MIME::Base64;
use AsposeCellsCloud::CellsApi;
my $config = AsposeCellsCloud::Configuration->new( client_id => $ENV{'CellsCloudClientId'}, client_secret => $ENV{'CellsCloudClientSecret'});
my $instance = AsposeCellsCloud::CellsApi->new(AsposeCellsCloud::ApiClient->new( $config));
my $remoteFolder = 'TestData/In';
my $book1Xlsx = 'Book1.xlsx';
my $outFormat = 'PDF';
my $request = AsposeCellsCloud::Request::SplitRemoteSpreadsheetRequest->new();
$request->{name} = $book1Xlsx;
$request->{folder} = $remoteFolder;
$request->{out_format} = $outFormat;
$request->{out_path} = 'TestData/Out';
$instance->split_remote_spreadsheet(request=> $request);
Go
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 main
import (
"os"
asposecellscloud "github.com/aspose-cells-cloud/aspose-cells-cloud-go"
)
func main() {
instance := asposecellscloud.NewCellsApiService(os.Getenv("ProductClientId"), os.Getenv("ProductClientSecret"), "https://api.aspose.cloud", "v3.0")
remoteFolder := "TestData/In"
book1Xlsx := "Book1.xlsx"
outFormat := "PDF"
request := new (asposecellscloud.SplitRemoteSpreadsheetRequest)
request.Name = book1Xlsx
request.Folder = remoteFolder
request.OutFormat = outFormat
request.OutPath = "TestData/Out"
_, httpResponse, err := instance.SplitRemoteSpreadsheet(request)
if err != nil {
t.Error(err)
} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
t.Fail()
}
}