Hi,
For several months ago, i've used this code to add data into Spreadsheet
using TableEntry & it worked correctly.
*// --- Create new spreadsheet entry*
> SpreadsheetEntry newEntry = new SpreadsheetEntry();
> newEntry.setTitle(new PlainTextConstruct(title));
> client.insert(new
> URL("https://docs.google.com/feeds/default/private/full"), newEntry)
>
> *// --- Retrieve latest entry from google docs*
> FeedURLFactory factory = FeedURLFactory.getDefault();
> URL spreadSheetFeedURL = new
> URL("https://spreadsheets.google.com/feeds/spreadsheets/private/full");
>
> SpreadsheetFeed feed = service.getFeed(spreadSheetFeedURL,
> SpreadsheetFeed.class);
> com.google.gdata.data.spreadsheet.SpreadsheetEntry latestEntry =
> feed.getEntries().get(0);
>
> *// --- Create Worksheet*
> WorksheetEntry worksheetEntry = new WorksheetEntry();
> worksheetEntry.setTitle(new PlainTextConstruct(workSheetName));
> worksheetEntry.setRowCount(tableRowCount+1);
> worksheetEntry.setColCount(toCol-fromCol);
>
> URL worksheetFeedUrl = latestEntry.getWorksheetFeedUrl();
> service.insert(worksheetFeedUrl, worksheetEntry);
>
> *// --- Create TableEntry for the Worksheet*
> TableEntry tableEntry = new TableEntry(worksheetEntry);
> tableEntry.setTitle(new PlainTextConstruct(workSheetName));
> tableEntry.setWorksheet(new Worksheet(workSheetName));
> tableEntry.setHeader(new Header(1));
>
> *// --- Create TableEntry data*
> Data tableData = new Data();
> tableData.setNumberOfRows(5);
> tableData.setStartIndex(2);
>
> *// --- Add 1 column for testing*
> tableData.addColumn(new Column("a", "abc"));
> tableEntry.setData(tableData);
>
> *// --- Insert TableEntry into SpreadSheet*
> URL tablesFeedUrl = factory.getTableFeedUrl(latestEntry.getKey());
> service.insert(tablesFeedUrl, tableEntry);
>
But for some recent days, it does not work & I could not add data into
SpreadSheet anymore. I know that SpreadSheet API has upgraded to version
3.0. Does it mean that this code is no longer correct? Do I have to do this
task again with API version 3.0?
I have used very simple Table data with just 1 Column (for testing only)
but it still does not work. I got this Exception:
com.google.gdata.util.ServiceException: OK Internal Error
com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:624)
Could someone help me with this? It would be appreciated.
Tks,
Nguyen
--
You received this message because you are subscribed to the Google Groups
"Google Spreadsheets API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.