2013-02-12 4 views
3

Google 스프레드 시트를 사용하려면 Google 스프레드 시트 api를 사용합니다.Google 스프레드 시트 행을 쿼리하는 중

임 시트에 질문하는 데 문제가 있습니다.

즉, 행의 첫 번째 셀에있는 값인 제목을 기반으로 특정 행을 가져 오는 데 문제가 있습니다. 현재 가로 스프레드 시트 대신 세로 레이아웃이 필요하므로 스프레드 시트에서 헤더를 사용하지 않습니다. .

listQuery.SpreadsheetQuery = "Select A"; 
내가 거기에 할 필요되어야 API 문서를 읽고에서

하지만 널 (null) 응답 메시지와 잘못된 요청 오류를 발생합니다 ..

AtomLink ListFeedLink = worksheet.Links.FindService(GDataSpreadsheetsNameTable.ListRel,   null); 

ListQuery listQuery = new ListQuery(ListFeedLink.HRef.ToString()); 
if (!string.IsNullOrEmpty(spreadsheetQuery)) 
{ 
    listQuery.SpreadsheetQuery = "age=25"; 
} 

ListFeed listFeed = myService.Query(listQuery); 

임 위의 코드를 사용하여

누구나 이런 식으로 스프레드 시트를 쿼리 할 수 ​​있습니다.

답변

2

귀하는 "현재 스프레드 시트에서 헤더를 사용하지 않습니다."라고 말합니다. ListFeed를 테스트했을 때, 헤더가 필요했습니다. 이것은 선택 사항이 아닙니다. CellFeed에는 헤더가 필요없고 검색 스타일 쿼리가 있습니다 (https://code.google.com/p/gdata-java-client/source/browse/trunk/java/sample/spreadsheet/cell/CellDemo.java

+0

) 이것은 올바른 대답이며 표시해야합니다. 헤더 행이 없으면 목록별로 Google 스프레드 시트를 쿼리 할 수 ​​없습니다. – bgmCoder