- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用文档列表 API 在 Google 文档上创建了电子表格模板的副本,我意识到:
1. title queries works fine
2. content queries are not working(*) or partially working(**)
(*)for majority of spreadsheets: I searched every word from the content of a spreadsheet and I get no results
(**) for a few spreadsheets I find results for some words that are copied from template; the particular words queries are not working
3. If I update the spreadsheet after a few minutes all queries work fine.
(I make this searches from UI)
这是创建此文件的步骤:
1. Copy spreadsheet template to root
private String sendPostCopyRequest(String authorizationToken, String resourceID, String title, int noRetries) throws IOException{
/*
resourceId = resource id for the template that i want to copy
title = the title of the new file created
*/
String urlStr = "https://docs.google.com/feeds/default/private/full";
URL url = new URL(urlStr);
HttpURLConnection copyHttpUrlConn = (HttpURLConnection) url.openConnection();
copyHttpUrlConn.setDoOutput(true);
copyHttpUrlConn.setRequestMethod("POST");
String outputString = "<?xml version='1.0' encoding='UTF-8'?>" +
"<entry xmlns=\"http://www.w3.org/2005/Atom\"> " +
"<id>https://docs.google.com/feeds/default/private/full/" + resourceID +"</id>" +
" <title>" + title + "</title></entry>";
copyHttpUrlConn.setRequestProperty("GData-Version", "3.0");
copyHttpUrlConn.setRequestProperty("Content-Type","application/atom+xml");
copyHttpUrlConn.setRequestProperty("Content-Length", outputString.length() + "");
copyHttpUrlConn.setRequestProperty("Authorization", "GoogleLogin auth=" + authorizationToken);
OutputStream outputStream = copyHttpUrlConn.getOutputStream();
outputStream.write(outputString.getBytes());
copyHttpUrlConn.getResponseCode();
return readIdFromResponse(copyHttpUrlConn.getInputStream());
}
2. I update some cells using this method:
public boolean setCellValue(SpreadsheetService spreadSheetService, SpreadsheetEntry entry, int worksheetNumber, String position, String value) throws IOException, ServiceException {
List<WorksheetEntry> worksheets = entry.getWorksheets();
WorksheetEntry worksheet = worksheets.get(worksheetNumber);
URL cellFeedUrl = worksheet.getCellFeedUrl();
CellQuery query = new CellQuery(cellFeedUrl);
query.setReturnEmpty(true);
query.setRange(position);
CellFeed cellFeed = spreadSheetService.query(query, CellFeed.class);
CellEntry cell = cellFeed.getEntries().get(0);
cell.changeInputValueLocal(value);
cell.update();
return true;
}
3. I move the created file to a new folder (collection)
public DocumentListEntry moveSpreadSheet(DocsService docsService, String entryId, String destinationFolderDocId) throws MalformedURLException, IOException, ServiceException {
DocumentListEntry newEntry = null;
newEntry = new com.google.gdata.data.docs.SpreadsheetEntry();
newEntry.setId(entryId);
String destFolderUri = "https://docs.google.com/feeds/default/private/full/folder%3A"+ destinationFolderDocId + "/contents";
return docsService.insert(new URL(destFolderUri), newEntry);
}
(the same results with gdata java sdk api 1.4.5, 1.4.6, 1.4.7)
这发生在 2011 年 12 月 23 日(近似值)。对于在此日期之前使用相同代码创建的所有电子表格,所有查询都工作正常。
我可以根据要求提供任何其他信息。
更新:
最佳答案
您的问题可能与 Google 电子表格内容索引速度缓慢有关。
https://groups.google.com/a/googleproductforums.com/d/msg/docs/vEhI_HkKX3I/MGKqkryrx90J
“目前,可能需要大约 10 分钟才能将您写入电子表格的内容编入索引。因此,如果您输入某些内容,然后立即搜索它,它可能还不会显示在您的列表中记录结果。再等几分钟(我们正在努力加快速度)”
关于java - 在电子表格中搜索不适用于创建的新文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10334919/
我这里有一个工作示例。 https://developers.google.com/google-apps/spreadsheets/我需要从用户的谷歌文档下载一些文件。 import com.goo
我需要您在以下方面的帮助: 假设我们有 3 个不同的组:(A、B、C) 我们在每个组中有几个值范围: (Eg. A has 0 - 100, 101 - 200 while B has 0 - 200
谁能告诉我有什么方法可以从 python 连接到电子表格吗?我想从表单中存储一些数据并将其提交到谷歌电子表格。请帮助解决这个问题。我必须遵循哪些步骤? 提前致谢... 最佳答案 连接到 Google
我正在尝试计算 2019 年给定时间范围内的月数。 我的数据如下所示: 我将开始日期和结束日期列的格式更改为“日期”。 “以月为单位的持续时间”和输出列具有数字格式。 我接近它如下: 如果开始日期(年
在设计上有一点问题,希望我能在这里寻求建议。接受 grails 可能是完全错误的工具,但这就是生活。 所以一直在努力开发一个网络应用程序,该应用程序基本上只是从谷歌电子表格中呈现大量信息并发回一些更新
我正在设计一个胖客户端(即非浏览器)Python 应用程序,它将与托管数据库进行通信。该应用程序的屏幕之一需要有一个网格/电子表格区域,允许显示多行数据、过滤、排序和更新多行信息。有人推荐一个具有此功
我在 Django 中有一个表单,可以将用户添加到 mySQL 数据库。然而,用户将不得不添加大量用户,并且一些信息将被复制和粘贴。所以我在想是否有一种方法可以有一个类似表单的电子表格,其中列标题是将
我在 Outlook VBA 中编写了一个程序,它根据 Excel 电子表格的内容创建一些电子邮件。一切正常,但是当程序终止时,我继续运行“EXCEL.EXE”进程,该进程会锁定电子表格,因此其他人无
如何使用公式来确定当前时区? 我使用的公式给出了意想不到的结果。 我的电子表格设置(文件 > 电子表格设置...): 时区: (GMT+01:00) 阿姆斯特丹 我使用的公式: =TEXT(NOW()
如何转换持续时间的小时数? 示例:在单元格 A1 中,我有 176 . 我希望单元格 A2 有 176:00:00 我想在 176 小时(持续时间)内转换数字 176。那可能吗?因为如果我在单元格中键
我收到了 4 个不同的采购订单,上面有一个随机的采购订单编号。 我仅在 A 列中填写采购订单号。 对于这个例子,我收到了下面列出的 4 个不同的采购订单。 采购订单 697533 - 2 项 采购订单
我需要编写循环遍历数据列的程序。根据单元格值和代表变量的每一列重置变量。 练习中的变量取决于循环的这些值。 如何在循环的每次迭代中将值增加 1 来循环遍历行? df=pd.DataFrame(r'C:
我正在做一些详尽的搜索,需要确定新域 (URL) 是否已经在电子表格中。但是,没有一个电子表格对象具有搜索功能,即在大多数文档对象中找到的 findText()。我觉得我错过了一些重要的东西。 我错过
我正在尝试在 Pandas 中导入一个 excel 电子表格,但由于数据“由用户在视觉上构建”以在视觉上对用户友好并且没有使用正确的数据结构,因此我遇到了一些问题。 结果,当在 Pandas 中作为数
我必须在 HTML 页面上显示多个图表,但我无法进行多个查询(直接在 google 电子表格上)。 实际上,我只是第一个查询显示的是谁。 我的代码: Page de pilotage
我使用以下代码作为将 html 网站上的用户输入数据发送到 Google 电子表格的方法: Javascript: function postContactToGoogle() { v
我有一个使用 Google Drive 和电子表格 API 的网站。我想要做的是,如果没有找到具有特定条件的电子表格,则在用户的 Google 云端硬盘上创建电子表格。该电子表格应该是我的 Googl
我目前链接到六个 Excel 电子表格,主要是因为用户在 Excel 中编辑数据更容易/更好(他们从未使用过 Access),而且任何更改都会立即反射(reflect),包括是否有新列添加后即可立即供
我正在努力通过 PowerShell 添加指向可变长度电子表格的链接,无论如何我都会遇到错误。这是我目前正在尝试制作的循环,它嵌套在一个 excel comobject 中, $sheet 代表 $e
在 Excel 电子表格中编写许多工作表可能需要一段时间。并行化它会很有帮助。 此代码运行良好,它使一个 Excel 电子表格在屏幕上弹出,其中包含四个名为 Sheet1、1、2 的工作表 和 3。
我是一名优秀的程序员,十分优秀!