使用Google表格API v4,我希望获得附加到我的帐户的电子表格列表.我做了很多研究,但没有找到任何解决方案.
我正在使用gd_client.UpdateCell来更新谷歌电子表格中的值,我正在寻找一种方法来更新单元格的格式,即颜色,线条,文本化......
可以这样做吗?
有可用的示例或其他文档吗?
让我走的任何事都会很棒
python formatting google-spreadsheet-api google-api-python-client google-sheets-api
我正在使用Google Visualization Javascript API从Google表格中加载图表并将其显示在div中.我的应用程序托管在Google App Engine上.我提供了工作表的URL,其中的参数gid=1用于指定第二个工作表,但显示的图表是第一个工作表.这是我的简化代码(它基本上是文档中提供的示例代码):
// sheetUrl is the URL of the Google sheet, e.g., http://https://docs.google.com/a/google.com/spreadsheet/ccc?key=0AobNU9T3MusKdGFqRHNJYkFnb3RuSkt4QlE#gid=1
// divId is the id of the <div> element I'm displaying in
google.load('visualization', '1.0', {packages: ['table']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var query = new google.visualization.Query(sheetUrl);
query.send(handleQueryResponse);
}
function handleQueryResponse(response) {
var data = response.getDataTable();
var table = new google.visualization.Table(document.getElementById(divId));
table.draw(data);
}
Run Code Online (Sandbox Code Playgroud)
您可以#gid=1在URL中看到.我也试过&gid=1和&sheet='Volume',这是选项卡的名称,但在页面加载时,从第一标签中的数据被渲染.
我已经注意到我上面的表格中的Google表格网址,但也是以这种形式:
https://docs.google.com/spreadsheet/tq?key=0AobNU9T3MusKdGFqRHNJYkFnb3RuSkt4QlE
Run Code Online (Sandbox Code Playgroud)
我无法找到任何明确解释tq端点的文档.我尝试使用此表单中的URL,但在尝试加载图表时出现超时错误.任何人都遇到这个问题或者对tq事情有所了解?谢谢!
编辑2014-02-17:
我已经更改了我的URL以使用tq端点,我尝试了以下参数:
#gid=1
&gid=1
#sheet=Volume
&sheet=Volume
Run Code Online (Sandbox Code Playgroud)
当我在浏览器中查询url时:
https://docs.google.com/spreadsheet/tq?key=0AobNU9T3MusKdGFqRHNJYkFnb3RuSkt4QlE&sheet=Volume
Run Code Online (Sandbox Code Playgroud)
我得到了合适的纸张.但是当我使用Visualization API进行查询时,我得到了第一张表.
javascript google-app-engine google-visualization google-spreadsheet-api
我正在使用新的Google云端硬盘Android API,我可以连接,并执行所有允许我这样做的操作,但为了使用SpreadsheetService,我需要从已登录的用户中提取accountName/email.
我怎么做?
这是我连接Google Drive API的代码.它工作正常.
private void connect() {
if (isGooglePlayServicesAvailable()) {
if (mGoogleApiClient == null) {
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(Drive.API)
.addScope(Drive.SCOPE_FILE)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
}
// And, connect!
if (!mGoogleApiClient.isConnecting() && !mGoogleApiClient.isConnected()) {
mGoogleApiClient.connect();
writeLog("Connecting...");
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是我使用SpreadsheetService API的地方,但我需要帐户名来获取令牌.
String accountName = "???"; // how do I get this From GoogleClientApi / mGoogleApiClient ?
String accessToken = GoogleAuthUtil.getTokenWithNotification(GDriveActivity.this, accountName, scope, null);
SpreadsheetService service = new SpreadsheetService("v1");
Run Code Online (Sandbox Code Playgroud)
我试过这个添加这个:
String accountName = …Run Code Online (Sandbox Code Playgroud) 我在互联网上找到了代码示例,用于从最新版Google表格中读取数据,如下所示:
SpreadsheetService service = new SpreadsheetService("Print Google Spreadsheet Demo");
service.setUserCredentials(GOOGLE_ACCOUNT_USERNAME, GOOGLE_ACCOUNT_PASSWORD);
URL metafeedUrl = new URL(SPREADSHEET_URL);
SpreadsheetEntry spreadsheet = service.getEntry(metafeedUrl, SpreadsheetEntry.class);
URL listFeedUrl = ((WorksheetEntry) spreadsheet.getWorksheets().get(0)).getListFeedUrl();
Run Code Online (Sandbox Code Playgroud)
但我找不到任何示例,访问特定版本的Google表格并获取该修订版中的单元格值.
如果可以使用Google电子表格API完成上述要求,请告知我们.
我正在使用谷歌脚本,我想检查一个单元格的类型,如果它的字符串做某事,如果是一个数值.做点别的.
我找不到像isString或isText这样的函数.
这是我的代码,typeof没有检测到单元格包含数字
function Results() {
var activeSheet = SpreadsheetApp.getActiveSpreadsheet();
var pred = activeSheet.getSheetByName("Copy of Predictions");
var real = activeSheet.getSheetByName("16 Results");
var realRes = real.getRange("B7:B61");
var realVal = realRes.getValues();
var cell, cellValue, row, col;
for(col=2;col<16;col++){
var predRes = pred.getRange(7, col, realVal.length);
var predVal = predRes.getValues();
for(row=0;row<predVal.length;row++){
if(predVal[row] == ""){
continue;
}else if(typeof predVal[row] === "number"){
if((predVal[row][0] == realVal[row][0]) && (predVal[row+1][0] == realVal[row+1][0])){
cell = pred.getRange(col, 3);
cellValue = cell.getValue();
cell.setValue(cellValue + 15);
}else{
if(((predVal[row][0] - predVal[row+1][0]) < 0) && ((realVal[row][0] …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Java进行编程以连接到Google Spreadsheet以进行数据检索或修改单元格中的数据.
我的Google电子表格链接是https://docs.google.com/spreadsheets/d/1UXoGD2gowxZ2TY3gooI9y7rwWTPBOA0dnkeNYwUqQRA
我查看了Sheets API,它需要链接
https://spreadsheets.google.com/feeds/worksheets/key/private/full
我尝试过不同形式的链接,例如:
https://spreadsheets.google.com/feeds/worksheets/1UXoGD2gowxZ2TY3gooI9y7rwWTPBOA0dnkeNYwUqQRA/private/full
https://spreadsheets.google.com/feeds/worksheets/1UXoGD2gowxZ2TY3gooI9y7rwWTPBOA0dnkeNYwUqQRA/private/full
他们分别给了我不同的错误:
com.google.gdata.util.ParseException: Unrecognized content type:application/binarycom.google.gdata.util.RedirectRequiredException: Moved Temporarily我不知道如何使用Java连接到Googl Spreadsheet.如果您有这方面的经验,请帮助我.
import com.google.gdata.client.authn.oauth.*;
import com.google.gdata.client.spreadsheet.*;
import com.google.gdata.data.*;
import com.google.gdata.data.batch.*;
import com.google.gdata.data.spreadsheet.*;
import com.google.gdata.util.*;
import org.testng.annotations.Test;
import java.io.IOException;
import java.net.*;
import java.util.*;
public class TestGoogleSheetsAPI {
@Test
public void testConnectToSpreadSheet() throws ServiceException, IOException {
SpreadsheetService service = new SpreadsheetService("google-spreadsheet");
URL SPREADSHEET_FEED_URL = new URL("https://spreadsheets.google.com/feeds/worksheets/1UXoGD2gowxZ2TY3gooI9y7rwWTPBOA0dnkeNYwUqQRA/public/full");
SpreadsheetFeed feed = service.getFeed(SPREADSHEET_FEED_URL, SpreadsheetFeed.class);
List<SpreadsheetEntry> spreadsheets = feed.getEntries();
if (spreadsheets.size() == 0) {
// TODO: …Run Code Online (Sandbox Code Playgroud) 我正在阅读v4 API,但无法满足我自己的问题。我想构建一个应用程序来收集单个电子表格的先前修订版本。(具体来说,我希望能够获得以前修订版的全部内容。)这在 v4 API 中是否可行?如果可以,我可以获得完整的修订快照,还是 API 只返回差异信息?
我想引用合并的单元格并从属于合并单元格范围内的任何单元格获取合并单元格的值。
=CONCATENATE(A2, " ",B2)在 C1 中使用并将其向下拖动适用于:未合并的单元格,以及合并单元格的第一个单元格。它不适用于合并组中的后续单元格。这在 MS Excel 中按预期工作,但在 Google 电子表格中无效,有没有办法实现这一点?
我正在开发一个Python 2.7脚本来分析SQL表中的数据,最后生成一个CSV文件.
生成文件后,我正在登录我的Google工作表帐户并使用导入选项将我的CSV文件导入到Google电子表格中
手工劳动有点愚蠢,我希望将这种能力添加到我的脚本中.
所以,我按照本指南Python Quickstart完成了所有步骤.
然后我按照Google表格API参考并查看了Method:spreadsheets.create.如果我理解正确,它不提供从文件导入的选项.
似乎没有用于导入功能的API.
如何使用Google表格API V4导入CSV文件?他们是我失踪的榜样/参考吗?