在 Google Spreadsheet API 上获取合并的单元格宽度 [英] Getting a merged cell width on Google Spreadsheet API

查看:49
本文介绍了在 Google Spreadsheet API 上获取合并的单元格宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Google 电子表格 API 将包含工人轮班的文档转换为活动日历.唯一的问题是班次由合并的单元格根据天数和小时数表示(以天数和小时数为行,不同的工作槽为列),当我读取某个单元格时,该单元格已合并并跨越 6 个单元格,我不能获取单元格一定的宽度或其合并区域.

I'm using the Google Spreadsheet API to convert a document containing workers shifts into event calendars. The only problem is that shifts are represented by merged cells according to days and hours (with days and hours as rows and different work slots as cols), and when I read a certain cell, which is merged and spans over 6 cells, I cannot get the cells certain width or its merged area.

例如:

如果我尝试获取 (4C:4E) 之间的值,我将得到Bob, , ,"而不是bob,bob,bob",我什至找不到一种方法来知道有多少个单元格bob"

If I try to get the values between (4C:4E) I will get "Bob, , ," and not "bob,bob,bob", and I cannot even find a way to know how many cells "bob" take.

你们知道我怎么知道合并后的单元格扩展到多少个单元格吗?或者至少是总宽度.

Do you guys know how can I know how many cells the merged one spread to? Or at least it's total width.

提前致谢!

推荐答案

无法通过电子表格 API.我正在寻找相同的.谷歌在他们的文档中承认了这一点.

It's not possible via spreadsheet API. I was looking for same. Google admits the same in their documentation.

单元格元素的字面值是计算出的值单元格,未应用格式.如果单元格包含公式,则这里给出了计算值.电子表格 API 没有格式,因此无法操作单元格的格式.

The literal value of the cell element is the calculated value of the cell, without formatting applied. If the cell contains a formula, the calculated value is given here. The Spreadsheets API has no concept of formatting, and thus cannot manipulate formatting of cells.

相关问题:使用其 API & 在 Google Sheets 电子表格中设置单元格格式蟒蛇

另一种方法是以编程方式下载 excel 格式的文档.它将包含格式信息.然后使用excel API提取信息.

One alternate way can be to download the doc in excel format programmatically. It will contain formatting information. Then using excel API to extract the info.

这篇关于在 Google Spreadsheet API 上获取合并的单元格宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆