Cells 接口描述

 

操作Excel工作表中的单元格,行以及列,包括合并/取消合并单元格,复制,获取单元格,设置单元格样式等;插入/提取,分组/取消分组,隐藏/取消隐藏,复制,删除工作表中的行或列。

接口方法1: clearContents()清除指定单元格中的内容

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel/{name}/worksheets/{sheetName}/cells/clearcontents

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
range string   指定单元格范围
startRow integer($int32)   起始行
startColumn integer($int32)   起始列
endRow integer($int32)   末行
endColumn integer($int32)   末列
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class deleteDocumentProperty {
   
    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);
    
    public static void main(String[] args) throws ApiException {

        String name = "ClearContents.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet4";
        String range = "A1:G19";
        int startRow = 1;
        int startColumn = 1;
        int endRow = 5;
        int endColumn = 8;
        cellsApi.clearContents(name, sheetName, range, startRow, startColumn, endRow, endColumn, folder, storage);
    }
}

接口方法2:clearFormats()清除指定单元格的格式

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/clearformats

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
range string   指定单元格范围
startRow integer($int32)   起始行
startColumn integer($int32)   起始列
endRow integer($int32)   末行
endColumn integer($int32)   末列
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class clearFormats {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {

        String name = "ClearFormats.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet4";
        String range = "A1:G19";
        int startRow = 1;
        int startColumn = 1;
        int endRow = 5;
        int endColumn = 8;
        cellsApi.clearFormats(name, sheetName, range, startRow, startColumn, endRow, endColumn, folder, storage);
    }
}

接口方法3:mergeCells()合并单元格

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/merge

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
startRow integer($int32)   起始行
startColumn integer($int32)   起始列
totalRows integer($int32)   总行数
totalColumns integer($int32)   总列数
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class mergeCells {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {

        String name = "MergeCells.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet4";
        int startRow = 2;
        int startColumn = 3;
        int totalRows = 4;
        int totalColumns = 4;
        cellsApi.mergeCells(name, sheetName, startRow, startColumn, totalRows, totalColumns, folder, storage);
    }
}

接口方法4:unmergeCells()取消单元格合并

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/unmerge

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
startRow integer($int32)   起始行
startColumn integer($int32)   起始列
totalRows integer($int32)   总行数
totalColumns integer($int32)   总列数
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class unmergeCells {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {

        String name = "UnMergeCells.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet2";
        int startRow = 3;
        int startColumn = 1;
        int totalRows = 1;
        int totalColumns = 2;
        cellsApi.unmergeCells(name, sheetName, startRow, startColumn, totalRows, totalColumns, folder, storage);
    }
}

接口方法5:getCells()获取单元格

HTTP 请求方法:GET

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
offset integer($int32)   起始偏移值,默认值为0
count integer($int32)   响应最大单元格数量,默认为0
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;
import spire.cloud.excel.sdk.model.Cells;

public class getCells {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {

        String name = "GetCells.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet1";
        int offset = 0;
        int count = 0;
        Cells response = cellsApi.getCells(name, sheetName, offset, count, folder, storage);
    }
}

接口方法6:setRangeValue()设置Excel工作表的范围值

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cellshttps://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
cellarea string   单元格区域
value string   范围值
type                                  string   数字值的类型,如int
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class setRangeValue {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {

        String name = "SetRangeValue.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet1";
        String cellarea = "A1:C3";
        String value = "250.5";
        String type = "double";
        cellsApi.setRangeValue(name, sheetName, cellarea, value, type, folder, storage);
    }
}

接口方法7:getCellStyle()获取单元格样式

HTTP 请求方法:GET

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/{cellName}/style

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
cellName string   指定单元格名称
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;
import spire.cloud.excel.sdk.model.Style;

public class getCellStyle {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {

        String name = "GetCellStyle.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet4";
        String cellName = "A4";
        Style response = cellsApi.getCellStyle(name, sheetName, cellName, folder, storage);
    }
}

接口方法8:setCellStyle()设置单元格样式

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/{cellName}/style

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
cellName string   指定单元格名称
style object { "SelfUri": { "Relation": "Relation", "Href": "Href", "Title": "Title", "LinkType": "LinkType" }, "Font": { "Color": { "A": 0, "R": 6, "B": 5, "G": 1 }, "DoubleSize": 0, "IsBold": true, "IsItalic": true, "IsStrikeout": true, "IsSubscript": true, "IsSuperscript": true, "Name": "string", "Size": 0, "Underline": "string" }, "Name": "string", "CultureCustom": "string", "Custom": "string", "BackgroundColor": { "A": 0, "R": 6, "B": 5, "G": 1 }, "ForegroundColor": { "A": 0, "R": 6, "B": 5, "G": 1 }, "IsFormulaHidden": true, "IsDateTime": true, "IsTextWrapped": true, "IsGradient": true, "IsLocked": true, "IsPercent": true, "ShrinkToFit": true, "IndentLevel": 0, "Number": 0, "RotationAngle": 0, "Pattern": "string", "TextDirection": "string", "VerticalAlignment": "string", "HorizontalAlignment": "string", "BorderCollection": [ { "LineStyle": "string", "Color": { "A": 0, "R": 6, "B": 5, "G": 1 }, "BorderType": "string" } ], "BackgroundThemeColor": { "ColorType": "ColorType", "Tint": 2.3 }, "ForegroundThemeColor": { "ColorType": "ColorType", "Tint": 2.3 } } 设置单元格样式
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;
import spire.cloud.excel.sdk.model.Border;
import spire.cloud.excel.sdk.model.Color;
import spire.cloud.excel.sdk.model.Font;
import spire.cloud.excel.sdk.model.Style;
import java.util.ArrayList;
import java.util.List;

public class setCellStyle {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {

        String name = "SetCellStyle.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet4";
        String cellName = "C8";
        Style style = new Style();
        Font font = new Font();
        font.setIsBold(true);
        font.setIsBold(true);
        font.setIsItalic(true);
        font.setUnderline("Single");
        font.setName("Algerian");
        font.setSize(8);
        style.setFont(font);
        style.setBackgroundColor(new Color(255,0,255,0));
        style.setHorizontalAlignment("Center");
        List list1= new ArrayList();
        Border border1 = new Border();
        border1.setLineStyle("Medium");
        border1.setColor(new Color(255, 255, 0, 0));
        border1.setBorderType("EdgeTop");
        list1.add(border1);
        Border border2 = new Border();
        border2.setLineStyle("DashDot");
        border2.setColor(new Color(255, 0, 255, 0));
        border2.setBorderType("EdgeRight");
        list1.add(border2);
        style.setBorderCollection(list1);
        Style response = cellsApi.setCellStyle(name, sheetName, cellName, style, folder, storage);
    }
}

接口方法9:updateRangeStyle()更新单元格区域格式

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/style

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
range string   指定单元格区域
style object { "SelfUri": { "Relation": "Relation", "Href": "Href", "Title": "Title", "LinkType": "LinkType" }, "Font": { "Color": { "A": 0, "R": 6, "B": 5, "G": 1 }, "DoubleSize": 0, "IsBold": true, "IsItalic": true, "IsStrikeout": true, "IsSubscript": true, "IsSuperscript": true, "Name": "string", "Size": 0, "Underline": "string" }, "Name": "string", "CultureCustom": "string", "Custom": "string", "BackgroundColor": { "A": 0, "R": 6, "B": 5, "G": 1 }, "ForegroundColor": { "A": 0, "R": 6, "B": 5, "G": 1 }, "IsFormulaHidden": true, "IsDateTime": true, "IsTextWrapped": true, "IsGradient": true, "IsLocked": true, "IsPercent": true, "ShrinkToFit": true, "IndentLevel": 0, "Number": 0, "RotationAngle": 0, "Pattern": "string", "TextDirection": "string", "VerticalAlignment": "string", "HorizontalAlignment": "string", "BorderCollection": [ { "LineStyle": "string", "Color": { "A": 0, "R": 6, "B": 5, "G": 1 }, "BorderType": "string" } ], "BackgroundThemeColor": { "ColorType": "ColorType", "Tint": 2.3 }, "ForegroundThemeColor": { "ColorType": "ColorType", "Tint": 2.3 } } 更新区域样式
folder string   存放原文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;
import spire.cloud.excel.sdk.model.Border;
import spire.cloud.excel.sdk.model.Color;
import spire.cloud.excel.sdk.model.Font;
import spire.cloud.excel.sdk.model.Style;
import java.util.ArrayList;
import java.util.List;

public class updateRangeStyle {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {

        String name = "UpdateRangeStyle.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet1";
        String range = "A1:A10";
        Style style = new Style();
        Font font = new Font();
        font.setIsBold(true);
        font.setIsBold(true);
        font.setIsItalic(true);
        font.setUnderline("Single");
        font.setName("Algerian");
        font.setSize(8);
        style.setFont(font);
        style.setBackgroundColor(new Color(255,0,255,0));
        style.setHorizontalAlignment("Center");
        List list1= new ArrayList();
        Border border1 = new Border();
        border1.setLineStyle("Medium");
        border1.setColor(new Color(255, 255, 0, 0));
        border1.setBorderType("EdgeTop");
        list1.add(border1);
        Border border2 = new Border();
        border2.setLineStyle("DashDot");
        border2.setColor(new Color(255, 0, 255, 0));
        border2.setBorderType("EdgeRight");
        list1.add(border2);
        style.setBorderCollection(list1);
        cellsApi.updateRangeStyle(name,sheetName,range,style,folder,storage);
    }
}

接口方法10:setCellValue()设置单元格数值

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/{cellName}/value

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
cellName string   指定单元格名称
value string   指定单元格的值
type string   数值的类型,可以是string
formula string   单元格的公式,默认为null
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;
import spire.cloud.excel.sdk.model.Cell;

public class setCellValue {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "SetCellValue.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet1";
        String cellName = "C20";
        String value = "1";
        String type = "String";
        String formula = null;
        Cell response = cellsApi.setCellValue(name, sheetName, cellName, value, type, formula, folder, storage);
    }
}

接口方法11:getCell()获取单元格信息

HTTP 请求方法:GET

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/{cellName}/htmlstring

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
cellName string   指定单元格名称
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;
import java.io.File;

public class setCellValue {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "Sample.xlsx";
        String sheetName = "Sheet1";
        String cellName = "A2";
        String folder = null;
        String storage = null;
        File response = cellsApi.getCell(name,sheetName,cellName,folder,storage);
    }
}

接口方法12:getColumns()获取工作表中列的信息

HTTP 请求方法:GET

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/columns

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;
import spire.cloud.excel.sdk.model.Columns;

public class getColumns {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "GetColumns.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet1";
        Columns response = cellsApi.getColumns(name, sheetName, folder, storage);
    }
}

接口方法13:hideColumns()隐藏工作表中的列

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/columns/hide

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
startColumn integer($int32)   起始列
totalColumns integer($int32)   总列数
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class hideColumns {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "HideColumns.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet4";
        int startColumn = 2;
        int totalColumns = 4;
        cellsApi.hideColumns(name, sheetName, startColumn, totalColumns, folder, storage);
    }
}

接口方法14:unhideColumns()取消隐藏工作表中的列

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/columns/unhide

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
startColumn integer($int32)   起始列
totalColumns integer($int32)   总列数
width number($double)   指定新列的宽度,默认为null
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class unhideColumns {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "UnhideColumns.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet5";
        int startcolumn = 2;
        int totalColumns = 1;
        Double width = null;
        cellsApi.unhideColumns(name, sheetName, startcolumn, totalColumns, width, folder, storage);
    }
}

接口方法15:groupColumns()给工作表中的列分组

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/columns/group

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
firstIndex integer($int32)   起始列
lastIndex integer($int32)   末列
hide boolean   设置列的显示/隐藏状态
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class groupColumns {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "GroupColumns.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet4";
        int firstIndex = 1;
        int lastIndex = 4;
        Boolean hide = true;
        cellsApi.groupColumns(name, sheetName, firstIndex, lastIndex, hide, folder, storage);
    }
}

接口方法16:ungroupColumns()取消分组工作表中的列

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/columns/ungroup

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
firstIndex integer($int32)   起始列
lastIndex integer($int32)   末列
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class ungroupColumns {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "UngroupColumns.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet4";
        int firstIndex = 4;
        int lastIndex = 9;
        cellsApi.ungroupColumns(name, sheetName, firstIndex, lastIndex, folder, storage);
    }
}

接口方法17:copyColumns()复制工作表中的列

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/columns/copy

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
sourceColumnIndex integer($int32)   指定原来的列
destinationColumnIndex integer($int32)   指定目标列
columnNumber integer($int32)   复制的列数
worksheet string   指定目标工作表名称
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class copyColumns {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "CopyColumns.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet4";
        int sourceColumnIndex = 2;
        int destinationColumnIndex = 3;
        int columnNumber = 2;
        String worksheet = "Sheet2";
        cellsApi.copyColumns(name, sheetName, sourceColumnIndex, destinationColumnIndex, columnNumber, worksheet, folder, storage);
    }
}

接口方法18:setColumnStyle()设置列的样式

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/columns/{columnIndex}/style

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
columnIndex integer($int32)   指定列
style object { "SelfUri": { "Relation": "Relation", "Href": "Href", "Title": "Title", "LinkType": "LinkType" }, "Font": { "Color": { "A": 0, "R": 6, "B": 5, "G": 1 }, "DoubleSize": 0, "IsBold": true, "IsItalic": true, "IsStrikeout": true, "IsSubscript": true, "IsSuperscript": true, "Name": "string", "Size": 0, "Underline": "string" }, "Name": "string", "CultureCustom": "string", "Custom": "string", "BackgroundColor": { "A": 0, "R": 6, "B": 5, "G": 1 }, "ForegroundColor": { "A": 0, "R": 6, "B": 5, "G": 1 }, "IsFormulaHidden": true, "IsDateTime": true, "IsTextWrapped": true, "IsGradient": true, "IsLocked": true, "IsPercent": true, "ShrinkToFit": true, "IndentLevel": 0, "Number": 0, "RotationAngle": 0, "Pattern": "string", "TextDirection": "string", "VerticalAlignment": "string", "HorizontalAlignment": "string", "BorderCollection": [ { "LineStyle": "string", "Color": { "A": 0, "R": 6, "B": 5, "G": 1 }, "BorderType": "string" } ], "BackgroundThemeColor": { "ColorType": "ColorType", "Tint": 2.3 }, "ForegroundThemeColor": { "ColorType": "ColorType", "Tint": 2.3 } } 设置格式
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;
import spire.cloud.excel.sdk.model.Border;
import spire.cloud.excel.sdk.model.Color;
import spire.cloud.excel.sdk.model.Font;
import spire.cloud.excel.sdk.model.Style;
import java.util.ArrayList;
import java.util.List;

public class setColumnStyle {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "SetColumnStyle.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet4";
        int columnIndex = 2;
        Style style = new Style();
        Font font = new Font();
        font.setIsBold(true);
        font.setIsItalic(true);
        font.setUnderline("Single");
        font.setName("Algerian");
        font.setSize(8);
        style.setFont(font);
        style.setIsTextWrapped(true);
        style.setPattern("Solid");
        style.setPatternColor("red");
        style.setHorizontalAlignment("Center");
        style.setBackgroundColor(new Color(255,0,255,0));
        List list1= new ArrayList();
        Border border1 = new Border();
        border1.setLineStyle("Medium");
        border1.setColor(new Color(255, 255, 0, 0));
        border1.setBorderType("EdgeTop");
        list1.add(border1);
        List list2= new ArrayList();
        Border border2 = new Border();
        border2.setLineStyle("DashDot");
        border2.setColor(new Color(255, 0, 255, 0));
        border2.setBorderType("EdgeRight");
        list2.add(border2);
        style.setBorderCollection(list1);
        style.setBorderCollection(list2);
        cellsApi.setColumnStyle(name, sheetName, columnIndex, style, folder, storage);
    }
}

接口方法19:getColumn()根据索引获取列的数据

HTTP 请求方法:GET

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/columns/{columnIndex}

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
columnIndex integer($int32)   指定列的索引
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;
import spire.cloud.excel.sdk.model.*;

public class getColumn {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "GetColumn.xlsx";
        String sheetName = "Sheet4";
        int columnIndex = 2;
        String folder = "input";
        String storage = null;
        Column response = cellsApi.getColumn(name, sheetName, columnIndex, folder, storage);
    }
}

接口方法20:setColumnWidth()设置列的宽度

HTTP 请求方法:接口方法20:setColumnWidth()设置列的宽度

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/columns/{columnIndex}

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
columnIndex integer($int32)   指定列的索引
width number($double)   指定列的宽度
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class setColumnWidth {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "SetColumnWidth.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet1";
        int columnIndex = 2;
        Double width =30.5;
        cellsApi.setColumnWidth(name, sheetName, columnIndex, width, folder, storage);
    }
}

接口方法21:insertColumns()添加列到工作表

HTTP 请求方法:PUT

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/columns/{columnIndex}

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
columnIndex integer($int32)   指定列的索引
columns integer($int32)   指定列数
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class insertColumns {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "InsertColumns.xlsx";
        String folder = "inpot";
        String storage = null;
        String sheetName = "Sheet1";
        int columnIndex = 2;
        int columns = 2;
        cellsApi.insertColumns(name, sheetName, columnIndex, columns, folder, storage);
    }
}

接口方法22:deleteColumns()删除工作表中的列

HTTP 请求方法:DELETE

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/columns/{columnIndex}

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
columnIndex integer($int32)   指定列的索引
totalColumns integer($int32)   指定总列数
updateReference string   指定更新参数为true或false
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;
import spire.cloud.excel.sdk.model.Columns;

public class deleteColumns {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "DeleteColumns.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet4";
        Boolean updateReference = true;
        int columnIndex = 1;
        int totalColumns = 2;
        Columns response = cellsApi.deleteColumns(name, sheetName, columnIndex, totalColumns, updateReference,folder, storage);
    }
}

接口方法23:getRows()获取工作表中的行

HTTP 请求方法:GET

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/rows

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;
import spire.cloud.excel.sdk.model.Rows;

public class getRows {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "GetRows.xlsx";
        String sheetName = "Sheet1";
        String folder = "input";
        String storage = null;
        Rows response = cellsApi.getRows(name, sheetName, folder, storage);
    }
}

接口方法24:insertRows()插入新的行到工作表

HTTP 请求方法:PUT

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/rows

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
startRow integer($int32)   起始行
totalRows integer($int32)   总行数
formatAs string   可设置为FormatAsBefore, FormatAsAfter, FormatDefault
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;
import spire.cloud.excel.sdk.model.Rows;

public class insertRows {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "InsertRows.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet1";
        int startrow = 5;
        int totalRows = 2;
        String formatAs = "FormatAsBefore";
        cellsApi.insertRows(name, sheetName, startrow, totalRows, formatAs, folder, storage);
    }
}

接口方法25:deleteRows()删除工作表中的指定行

HTTP 请求方法:DELETE

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/rows

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
startRow integer($int32)   起始行
totalRows integer($int32)   总行数
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class deleteRows {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "DeleteRows.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet4";
        int rowIndex = 2;
        int totalRows = 2;
        Boolean updateReference = true;//Default value : true
        cellsApi.deleteRows(name, sheetName, rowIndex, totalRows,updateReference, folder, storage);
    }
}

接口方法26:hideRows()隐藏工作表中的指定行

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/rows/hide

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
startRow integer($int32)   起始行
totalRows integer($int32)   总行数
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class hideRows {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "HideRows.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet4";
        int startRow = 4;
        int totalRows = 4;
        cellsApi.hideRows(name, sheetName, startRow, totalRows, folder, storage);
    }
}

接口方法27:unhideRows()取消隐藏工作表中的指定行

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/rows/unhide

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
startRow integer($int32)   起始行
totalRows integer($int32)   总行数
height number($double)   新的行高,默认为null
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class unhideRows {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "UnhideRows.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet5";
        int startrow = 15;
        int totalRows = 4;
        Double height = null;
        cellsApi.unhideRows(name, sheetName, startrow, totalRows, height, folder, storage);
    }
}

接口方法28:groupRows()给工作表中的指定行进行分组

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/rows/group

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
firstIndex integer($int32)   指定起始行的索引
lastIndex integer($int32)   指定末行的索引
hide boolean   设置行的显示状态
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class groupRows {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "GroupRows.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet4";
        int firstIndex = 2;
        int lastIndex = 6;
        Boolean hide = true;
        cellsApi.groupRows(name, sheetName, firstIndex, lastIndex, hide, folder, storage);
    }
}

接口方法29:ungroupRows()取消分组工作表中的指定行

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/rows/ungroup

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
firstIndex integer($int32)   指定起始行的索引
lastIndex integer($int32)   指定末行的索引
isAll boolean   判断是否所有行都被执行操作
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class ungroupRows {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "UngroupRows.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet4";
        int firstIndex = 5;
        int lastIndex = 7;
        Boolean isAll = false;
        cellsApi.ungroupRows(name, sheetName, firstIndex, lastIndex, isAll, folder, storage);
    }
}

接口方法30:copyRows()复制行

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/rows/copy

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
sourceRowIndex integer($int32)   初始行的索引
destinationRowIndex integer($int32)   目标行的索引
rowNumber integer($int32)   复制的行数
worksheet string   指定目标工作表
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class copyRows {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "CopyRows.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet4";
        int sourceRowIndex = 1;
        int destinationRowIndex = 5;
        int rowNumber = 3;
        String worksheet = "Sheet2";
        cellsApi.copyRows(name, sheetName, sourceRowIndex, destinationRowIndex, rowNumber, worksheet, folder, storage);
    }
}

接口方法31:applyRowStyle()为工作表中的所有行设置样式

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/rows/{rowIndex}/style

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
rowIndex integer($int32)   指定行的索引
style object { "SelfUri": { "Relation": "Relation", "Href": "Href", "Title": "Title", "LinkType": "LinkType" }, "Font": { "Color": { "A": 0, "R": 6, "B": 5, "G": 1 }, "DoubleSize": 0, "IsBold": true, "IsItalic": true, "IsStrikeout": true, "IsSubscript": true, "IsSuperscript": true, "Name": "string", "Size": 0, "Underline": "string" }, "Name": "string", "CultureCustom": "string", "Custom": "string", "BackgroundColor": { "A": 0, "R": 6, "B": 5, "G": 1 }, "ForegroundColor": { "A": 0, "R": 6, "B": 5, "G": 1 }, "IsFormulaHidden": true, "IsDateTime": true, "IsTextWrapped": true, "IsGradient": true, "IsLocked": true, "IsPercent": true, "ShrinkToFit": true, "IndentLevel": 0, "Number": 0, "RotationAngle": 0, "Pattern": "string", "TextDirection": "string", "VerticalAlignment": "string", "HorizontalAlignment": "string", "BorderCollection": [ { "LineStyle": "string", "Color": { "A": 0, "R": 6, "B": 5, "G": 1 }, "BorderType": "string" } ], "BackgroundThemeColor": { "ColorType": "ColorType", "Tint": 2.3 }, "ForegroundThemeColor": { "ColorType": "ColorType", "Tint": 2.3 } } 设置样式
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;
import spire.cloud.excel.sdk.model.Border;
import spire.cloud.excel.sdk.model.Color;
import spire.cloud.excel.sdk.model.Font;
import spire.cloud.excel.sdk.model.Style;

import java.util.ArrayList;

public class applyRowStyle {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "ApplyRowStyle.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet2";
        int rowIndex = 3;
        Font font = new Font();
        font.setIsBold(true);
        font.setIsItalic(true);
        font.setUnderline("Single");
        font.setName("Algerian");
        font.setSize(8);
        Style style = new Style();
        style.setFont(font);
        style.setBackgroundColor(new Color(255,0,255,0));
        style.setHorizontalAlignment("Center");
        style.setBorderCollection(new ArrayList());
        Border border1 = new Border();
        border1.setLineStyle("Medium");
        border1.setColor(new Color(255,255,0,0));
        border1.setBorderType("EdgeTop");
        style.getBorderCollection().add(border1);
        Border border2 = new Border();
        border2.setLineStyle("DashDot");
        border2.setColor(new Color(255,0,255,0));
        border2.setBorderType("EdgeRight");
        style.getBorderCollection().add(border2);
        cellsApi.applyRowStyle(name, sheetName, rowIndex, style, folder, storage);
    }
}

接口方法32:getRow()获取指定行的信息

HTTP 请求方法:GET

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/rows/{rowIndex}

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
rowIndex integer($int32)   指定行的索引
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;
import spire.cloud.excel.sdk.model.*;

public class getRow {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "GetRow.xlsx";
        String sheetName = "Sheet4";
        int rowIndex = 2;
        String folder = "input";
        String storage = null;
        Row response = cellsApi.getRow(name, sheetName, rowIndex, folder, storage);
    }
}

接口方法33:updateRow()更新工作表中的指定行

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/rows/{rowIndex}

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
rowIndex integer($int32)   指定行的索引
height number($double)   设置新行的高度,默认值为0
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;
import spire.cloud.excel.sdk.model.*;

public class updateRow {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "UpdateRow.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet1";
        int rowIndex = 3;
        Double height = 26.5;
        Row response = cellsApi.updateRow(name, sheetName, rowIndex, height, folder, storage);
    }
}

接口方法34:insertRow()插入新的行到工作表

HTTP 请求方法:PUT

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/rows/{rowIndex}

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
rowIndex integer($int32)   指定新行的索引
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class insertRow {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "InsertRow.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet1";
        int rowIndex = 3;
        cellsApi.insertRow(name, sheetName, rowIndex, folder, storage);
    }
}

接口方法35:deleteRow()删除工作表中的指定行

HTTP 请求方法:DELETE

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/rows/{rowIndex}

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
rowIndex integer($int32)   指定行的索引
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class deleteRow {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "DeleteRow.xlsx";
        String folder = "input";
        String storage = null;
        String sheetName = "Sheet2";
        int rowIndex = 1;
        cellsApi.deleteRow(name, sheetName, rowIndex, folder, storage);
    }
}

接口方法36:copyCell()复制单元格数据

HTTP 请求方法:POST

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/{destCellName}/copy

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
destCellName string   目标单元格名称
sheetName string   目标工作表名称
worksheet string   原始工作表名称
cellname string   原始单元格名称
row integer($int32)   原始行
column integer($int32)   原始列
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

public class copyCell {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "CopyCell.xlsx";
        String storage = null;
        String folder = "input";
        String worksheet = "Sheet1";//Source
        String sheetName = "Sheet2";//Destination
        String cellname = "A13";//Source
        String destCellName = "F20";
        int row = 14;//Source row
        int column = 2;//Source column
        cellsApi.copyCell(name, destCellName, sheetName, worksheet, cellname, row, column, folder, storage);
    }
}

接口方法37:getCell()通过单元格名称或方法名来获取单元格数据

HTTP 请求方法:GET

请求URL:https://api.e-iceblue.cn/v1/excel /{name}/worksheets/{sheetName}/cells/{cellOrMethodName}

请求参数:

参数 是否必选 类型 可选值范围 说明
name string   文档名称
sheetName string   指定工作表名称
cellOrMethodName string   单元格或方法名称其中方法名可为the firstcell, endcell等
folder string   存放文档的文件夹,没有则为null
storage string   文档存储空间,使用冰蓝云配置的2G空间存贮文档,可设置为null

Java代码示例:

import spire.cloud.excel.sdk.ApiException;
import spire.cloud.excel.sdk.Configuration;
import spire.cloud.excel.sdk.api.CellsApi;

import java.io.File;

public class getCell {

    static String appId = "your id";
    static String appKey = "your key";
    static String baseUrl = "https://api.e-iceblue.cn";
    static Configuration configuration = new Configuration(appId, appKey, baseUrl);
    static CellsApi cellsApi = new CellsApi(configuration);

    public static void main(String[] args) throws ApiException {
        String name = "GetCell.xlsx";
        String sheetName = "Sheet1";
        String cellOrMethodName = "A2";
        String folder = "input";
        String storage = null;
        File response = cellsApi.getCell(name, sheetName, cellOrMethodName, folder, storage);
    }
}