我正在尝试向Google电子表格添加一行。他们提供了一个来源https://developers.google.com/google-apps/spreadsheets/#adding_a_list_row,但 该来源不适合我。任何人都可以告诉我,女巫包含名称“ row”的行有什么问题。“错误11名称'行'在当前上下文中不存在”
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Google.GData.Client;
using Google.GData.Spreadsheets;
namespace Google_test3
{
class Program
{
static void Main(string[] args)
{
string USERNAME = "test";
string PASSWORD = "test";
SpreadsheetsService service = new SpreadsheetsService("MySpreadsheetIntegration-v1");
service.setUserCredentials(USERNAME, PASSWORD);
// Instantiate a SpreadsheetQuery object to retrieve spreadsheets.
SpreadsheetQuery query = new SpreadsheetQuery();
// Make a request to the API and get all spreadsheets.
SpreadsheetFeed feed = service.Query(query);
if (feed.Entries.Count == 0)
{
Console.WriteLine("None");
}
// TODO: Choose …Run Code Online (Sandbox Code Playgroud) Google Drive API和Google Spreadsheet API(v 3.0)都支持获取与以下网址相对应的[KEY]的方法:
https://docs.google.com/spreadsheet/ccc?key=[KEY]
我对Google Drive API使用File.getId()方法,为Google Spreadsheet API使用SpreadsheetEntry.getId或.getKey()方法.
Google Drive API ...
for (File file : mResult) {
System.out.println(file.getTitle());
System.out.println(file.getId());
}
Run Code Online (Sandbox Code Playgroud)
Google SpreaSheet API ...
SpreadsheetEntry spreadsheet = spreadsheets.get(0);
System.out.println(spreadsheet.getKey());
Run Code Online (Sandbox Code Playgroud)
我的麻烦是我在Drive和Spreadsheet API之间找不到任何公共密钥,但两个密钥都链接到同一个资源......当用于替换浏览器中的[KEY]字段时,它们都检索相同的电子表格.
我正在尝试识别Google云端硬盘中特定文件夹中存在的电子表格,然后使用电子表格API仅处理这些文件.SpreadSheet API似乎只能返回Google驱动器上的所有文件 - 我看不到按文件夹限制结果的方法.因此,为什么我必须结合这两个API.
有什么想法吗?
我有200多个电子表格供客户填写.我开发了一个脚本来管理电子表格,其功能基本相同.
问题是当我修改脚本时,我需要在所有这些表中更改它.我尝试使用图书馆,但没有成功,我希望听到有人知道答案.
我在每个电子表格中包含的库版本(包含开发)未显示随后发生的更改.它只会显示包含时的结果,这意味着为了完成这项工作,我必须转到每个电子表格,删除库并重新安装最新版本.更新的库仅适用于我的所有者帐户.当然,任何有链接的人都可以共享图书馆.在任何电子表格中运行库的更新函数会产生错误:"TypeError:在对象[对象对象]中找不到函数FunctionName."(第2行,文件"test")"
有没有一种方法可以让所有电子表格都有一个代码,我可以随时更改?
我正在使用Google Spreadsheets API.我坚持想要创建一个新的电子表格.Google电子表格API仅说明了检索已创建的电子表格及其管理(包括单元格内容更新等).他们还列出了可以通过Google文档列表API上传电子表格文件来创建新的电子表格.我已经浏览了Google Documents List API,但我没有找到任何Java文档.他们只提供.Net文档.所以我的问题是"是否有可能以编程方式在Java/Android中创建新的电子表格?".
如果可能的话,任何人都可以引导我找到一个好的链接或博客或一篇文章.这对我很有帮助.
任何帮助将不胜感激 !!
更新:我不是在谈论在本地创建电子表格,而是在谈论通过API调用创建电子表格.以下是我的方案:我想将一些统计信息更新为电子表格.电子表格的名称格式为CURRENT_MONTH-SOME NAME.xls.因此,必须在每个月的月初自动创建电子表格.目前我在做什么,在年初,我将手动创建12个年度电子表格,并在每个月检索相应的电子表格,并根据我的需要插入或删除或修改月份的数据.所以我在这里搜索,我想让这个过程自动化(电子表格应该以编程方式创建.我也不喜欢安装Google Drive应用程序和将文件复制到Google Drive应用程序等依赖项,作为替代解决方案).
随着新版Google表格(电子表格)的推出,Gdata API不再适用.(请参阅https://support.google.com/drive/answer/3543688)是否有适用于新Google表格的新API或是否会更新Gdata以支持新表格?或者有任何变通方法吗?
这目前正在破坏我们的生产代码,该代码使用gdata API以编程方式从Google表格中读取内容.请帮忙!
我已经从Google云端硬盘创建了一个独立的应用脚本,但是当我尝试从Google电子表格访问它时,我看不到访问该脚本的方法(即使我创建脚本时,我将其创建为电子表格脚本).
在电子表格中,"工具 - >脚本管理器..."菜单项不显示我的脚本,"工具 - >脚本编辑器......"也没有显示.后者有一个"最近项目"的部分,但它没有列出我新创建的脚本,也没有列出其相关项目.
如果我从电子表格内部创建一个新脚本(即.Tools-> Script editor ...)并从独立脚本中剪切并粘贴代码,它就可以正常工作.但是,这只能在单个电子表格中使用 - 要从另一个电子表格中使用它,我必须再次剪切和粘贴/再次通过身份验证.
有没有办法在不将图片发布到图库的情况下执行此操作,我认为将其公开(我没有问题将其公开,但似乎必须有更好的方法)?脚本在这里 - 它是世界可读的链接.它为google电子表格添加了一个菜单,允许您在BigQuery中运行查询并将结果转储到电子表格中.
我在简单的Android应用程序中使用Google Spreadsheet API.这是一段代码:
URL spreadSheetUrl = new URL("https://spreadsheets.google.com/feeds/spreadsheets/private/full");
SpreadsheetQuery query = new SpreadsheetQuery(spreadSheetUrl);
query.setTitleQuery("xyz");
query.setTitleExact(true);
SpreadsheetFeed spreadSheetFeed = service.getFeed(query, SpreadsheetFeed.class);
Run Code Online (Sandbox Code Playgroud)
从我的应用程序的同步适配器调用这段代码.
我收到此错误:
com.google.gdata.util.ParseException: Unrecognized content type:application/binary
com.google.gdata.client.Service.parseResponseData(Service.java:2136)
com.google.gdata.client.Service.parseResponseData(Service.java:2098)
com.google.gdata.client.Service.getFeed(Service.java:1136)
com.google.gdata.client.Service.getFeed(Service.java:1077)
com.google.gdata.client.GoogleService.getFeed(GoogleService.java:676)
com.google.gdata.client.Service.getFeed(Service.java:1034)
Run Code Online (Sandbox Code Playgroud)
有人可以建议我如何解决这个问题吗?
我需要在google电子表格中添加多行(几百行).目前我正在循环中这样做:
for row in rows
_api_client.InsertRow(row, _spreadsheet_key, _worksheet_id)
Run Code Online (Sandbox Code Playgroud)
这是非常慢的,因为行是逐个添加的.
有什么方法可以加快速度吗?
1月22日,我收到一封电子邮件,主题是"重要:从已停止的文档列表API迁移的步骤",来自Google Apps.
重要说明:从已停止的Documents List API迁移的步骤
你好管理员,
最近,我们传达的是文档列表API将于2015年4月20日,停止这种变化意味着,服务于这个API调用将不再支持,并且正在使用该API将不再有效实施的任何谷歌Apps功能.
我们的记录表明您可能拥有使用Documents List API的应用程序,我们建议您尽快迁移到具有类似功能的 Drive API .
这是你需要做的:
确定您是否有应用程序向这些类型的URL发出请求:
- https://docs.google.com/feeds/
- https://docs.googleusercontent.com/
- https://spreadsheets.google.com/feeds/
将应用程序迁移到Drive API.如果您对迁移有疑问,请与Google Apps for Work支持小组联系.
此致,Google Apps for Work团队
我认为使用https://spreadsheets.google.com/feeds/的应用程序应该迁移到新的Drive API.但在新的Drive API中,也会使用此网址:https: //developers.google.com/google-apps/spreadsheets/#sheets_api_urls_visibilities_and_projections
在电子邮件或云端硬盘API文档中,网址中是否存在拼写错误?或者这封电子邮件说当你确定使用这些网址时,你可以吗?
PS:我在谷歌开了一个案子,但我担心迟到的回复,所以我在这里问.
我编写了一个脚本来连接到Google电子表格并从中将数据加载到postgresql数据库中.我已经创建了一个服务帐户并以.json格式获取了必要的凭据,问题是当我尝试与我的服务帐户电子邮件共享Google工作表时,我收到一封电子邮件说:
完全无法传送给下列收件人:
Run Code Online (Sandbox Code Playgroud)dataload@geometric-shine-118101.iam.gserviceaccount.com永久性故障的技术细节:DNS错误:geometric-shine-118101.iam.gserviceaccount.com的地址解析.失败:找不到域名
该电子邮件与我在.json密钥文件中的电子邮件完全相同.我已经检查了其他帖子,通常应该共享的电子邮件的结构是这样的:
project_name@developer.gserviceaccount.com
Run Code Online (Sandbox Code Playgroud)
但我的不同,也许它与此有关?我按照此链接上的说明操作.
这是.json密钥文件的副本:
{
"type": "service_account",
"project_id": "geometric-shine-118101",
"private_key_id": "xxx",
"private_key": "-----BEGIN PRIVATE KEY-----\nxxx\n-----END PRIVATE KEY-----\n",
"client_email": "dataload@geometric-shine-118101.iam.gserviceaccount.com",
"client_id": "117076930343404252458",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/dataload%40geometric-shine-118101.iam.gserviceaccount.com"
}
Run Code Online (Sandbox Code Playgroud)