如何获取Google电子表格中单个表格的表名 - Google Sheet Api v4 - Java [英] How to get Sheet Name of individual Sheets in Google Spreadsheet - Google Sheet Api v4 - Java

查看:424
本文介绍了如何获取Google电子表格中单个表格的表名 - Google Sheet Api v4 - Java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用Google Sheet Api v4获取Google电子表格中单个工作表的名称。

I am trying to get sheet name of individual sheets in Google Spreadsheet using Google Sheet Api v4.

我尝试了以下获取属性的方法:

I tried the following way that gets the properties:

  Spreadsheet response1= service.spreadsheets().get(spreadsheetId).setIncludeGridData (false).execute ();

  System.out.println (response1.getProperties ().getTitle ());

然而,它会显示实际电子表格的名称,而不是在电子表格中显示单个工作表的名称。

However it displays the name of the actual Spreadsheet rather than displaying the names of individual sheets in the Spreadsheet.

有人知道我们可以怎么做吗?

Do anyone know how we can go about it?

推荐答案

以下是上述问题的答案:

Below is the answer to above question:

Spreadsheet response1= service.spreadsheets().get(spreadsheetId).setIncludeGridData (false)
.execute ();

System.out.println (response1.getSheets ().get (0).getProperties ().getTitle ());

谢谢。

这篇关于如何获取Google电子表格中单个表格的表名 - Google Sheet Api v4 - Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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