部分CellFeed负载 [英] Partial CellFeed load

查看:171
本文介绍了部分CellFeed负载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新年快乐,伙计,

目前,我使用以下默认方式访问和加载Google表格工作表:

 网址metafeedUrl =新网址(SPREADSHEET_URL); 
SpreadsheetEntry spreadsheet = service.getEntry(metafeedUrl,SpreadsheetEntry.class);
URL cellFeedUrl =((WorksheetEntry)spreadsheet.getWorksheets()。get(0))。getCellFeedUrl();

//以单元格形式获取条目
feed =(CellFeed)service.getFeed(cellFeedUrl,CellFeed.class);

然后我使用它,等等。Everyting工作得很好。



问题:

我即将部署应用程序并使其与工作表一起工作,该工作表有几百个(如果不是千行的)细胞。对我来说,唯一相关的行通常是100-200个底部的



有没有办法部分加载CellFeed,最好是从自下而上? API是否提供这种方式?

解决方案

查看API本身,您可以使用单元格源或列表源来执行此操作。在单元格中添加
,请查看 https://developers.google .com / google-apps / spreadsheets /#fetching_specific_rows_or_columns

您可以在那里指定要获取的最小/最大的行/列,并且在那里还有一个java示例。
< br>
a更有效地获取数据的方式,是行数据源,因为它可以发送更少的字节数:
https://spreadsheets.google.com/feeds/list/

与未记录的起始索引参数,所以它只能从该行开始读取。

我使用它并适用于旧和新表单。

第一个您需要获取所有行(或尝试某种二进制查找来查找最后一个电子表格行)。
我没有使用过java api库,它很可能bly不允许使用无证参数。你总是可以直接从java或任何语言获得url,并直接通过https使用电子表格api。

很久以前我从这里获得了这个技巧:

< href =https://groups.google.com/forum/#!topic/google-spreadsheets-api/dSniiF18xnM =nofollow> https://groups.google.com/forum/#!topic/ google-spreadsheets-api / dSniiF18xnM

并将其用于此github项目(javascript ajax调用示例)

https://github.com/zmandel/Plus-for-Trello/blob/master/source/sql.js


Happy new year, folks,

Currently, I'm accessing and loading a Google Sheets worksheet using the following, default way:

URL metafeedUrl = new URL(SPREADSHEET_URL);
SpreadsheetEntry spreadsheet = service.getEntry(metafeedUrl, SpreadsheetEntry.class);
URL cellFeedUrl = ((WorksheetEntry) spreadsheet.getWorksheets().get(0)).getCellFeedUrl();

// Get entries as cells
feed = (CellFeed) service.getFeed(cellFeedUrl, CellFeed.class);

Then I work with it, etc. Everyting works just fine.

The problem:

I'm about to deploy the application and have it work with a Worksheet that has several hundred, if not thousand rows of cells. To me, the only relevant rows are usually the 100-200 bottom ones.

Is there a way to partially load a CellFeed, preferrably from the bottom up? Does the API provide such a way?

解决方案

Looking at the API itself, you can do it with cell feed or list feed.
in cell feed, look at https://developers.google.com/google-apps/spreadsheets/#fetching_specific_rows_or_columns
you can specify there the minimum/maximum row/columns to get, and there is also a java example in there.

a more efficient way to get your data, is the row feed as it sends less bytes in return:
https://spreadsheets.google.com/feeds/list/
with the undocumented "start-index' parameter so it only reads starting at that row.
I use this and works for the "old" and "new" sheets.
The first time you will need to get all rows (or attempt some sort of binary lookup to find the last spreadsheet row).
I have not used the java api library, it probably does not allow for that undocumented parameter. You can always do a url "get" directly from java or any language and use the spreadsheet api directly by https.
I got this tip a long time ago from here:
https://groups.google.com/forum/#!topic/google-spreadsheets-api/dSniiF18xnM
and use it on this github project (javascript ajax call example)
https://github.com/zmandel/Plus-for-Trello/blob/master/source/sql.js

这篇关于部分CellFeed负载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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