Ethercalc的单元格取值

本地架设Ethercalc后,访问http://localhost:8000进入ethercalc首页,创建新的工作簿,在A1单元格输入数据1,A2单元格输入数据2,A3输入公式(=A1+A2),页面显示如下:



取单元格数据代码如下:

import javax.ws.rs.client.Client;  
import javax.ws.rs.client.ClientBuilder;  
import javax.ws.rs.core.Response;  
import javax.ws.rs.core.MediaType;  
  
public class getValue {  
    public static void main(String args[]) {  
  
        Client client = ClientBuilder.newClient();  
        Response response = client  
                .target("http://localhost:8000/_/aaa/cells/A1")  
                .request(MediaType.TEXT_PLAIN_TYPE).get();  
  
        System.out.println("status: " + response.getStatus());  
        System.out.println("headers: " + response.getHeaders());  
        System.out.println("body:" + response.readEntity(String.class));  
    }  
} 


控制台显示:

A1单元格:

status: 200
headers: {ETag=[W/"59-3383904219"], Date=[Mon, 10 Oct 2016 08:22:41 GMT], Content-Length=[89], Connection=[keep-alive], Content-Type=[application/json; charset=utf-8], X-Powered-By=[Zappa 0.5.0]}
body:{"coord":"A1","datavalue":1,"datatype":"v","formula":"","valuetype":"n","readonly":false}

A3单元格:

status: 200
headers: {ETag=[W/"d3-496882608"], Date=[Mon, 10 Oct 2016 08:25:31 GMT], Content-Length=[211], Connection=[keep-alive], Content-Type=[application/json; charset=utf-8], X-Powered-By=[Zappa 0.5.0]}
body:{"coord":"A3","datavalue":3,"datatype":"f","formula":"A1+A2","valuetype":"n","readonly":false,"parseinfo":[{"text":"A1","type":2,"opcode":0},{"text":"+","type":3,"opcode":"+"},{"text":"A2","type":2,"opcode":0}]}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值