2014-03-27 4 views
1

Google 스프레드 시트 API 3.0.0 Java 라이브러리를 사용하고 있습니다. 새 데이터 세트를 기존 워크 시트에 추가하여 새 데이터가 이전 데이터에 추가되도록하고 싶습니다. 이 요구 사항을 달성하기위한 가능한 API가 있습니까? 그것은 기존 스프레드 시트에 행을 추가하여 간단하게 수행 할 수 있었던 것처럼Google 스프레드 시트 API 기존 스프레드 시트 데이터를 새 데이터 세트로 업데이트 (추가)하는 방법

덕분에, Chanaka

답변

1

은 당신이 제안하는 것은 같다.

// Fetch the list feed of the worksheet. 
URL listFeedUrl = worksheet.getListFeedUrl(); 
ListFeed listFeed = service.getFeed(listFeedUrl, ListFeed.class); 

// Create a local representation of the new row. 
ListEntry row = new ListEntry(); 
row.getCustomElements().setValueLocal("firstname", "Joe"); 
row.getCustomElements().setValueLocal("lastname", "Smith"); 
row.getCustomElements().setValueLocal("age", "26"); 
row.getCustomElements().setValueLocal("height", "176"); 

// Send the new row to the API for insertion. 
row = service.insert(listFeedUrl, row); 

출처 : https://developers.google.com/google-apps/spreadsheets/