getRange and getTableModel returning null

11 views
Skip to first unread message

rho...@opentrends.net

unread,
Apr 11, 2017, 4:31:52 AM4/11/17
to jOpenDocument
Hi, I have defined a named range in my libreoffice ods, but neither getRange nor getTableModel seem to get it, they both return null, do you know what could cause that behavior?


Thanks!


 System.out.println(String.valueOf(sheetInfo.getSpreadSheet().getRange("int")));

The SpreadSheet is fine, only the range is returned null





Advertiment legal: la informació d’aquest missatge de correu electrònic és confidencial i s’adreça exclusivament al destinatari previst. Si ha rebut el missatge per error, sisplau, notifiqui-ho al remitent i esborri’l sense copiar-lo, enregistrar-lo ni distribuir-lo.

Advertencia legal: la información de este mensaje de correo electrónico es confidencial y se dirige exclusivamente al destinatario previsto. Si usted ha recibido el mensaje por error, por favor, notifíquelo al remitente y bórrelo sin copiarlo, grabarlo ni distribuirlo.

Legal warning: the information contained in this e-mail message is confidential and is for the exclusive attention of the planned recipient. If you have received the message by error, please notify the sender and delete the message without copying, recording or distributing it.

Guillaume Maillard

unread,
Apr 11, 2017, 4:33:25 AM4/11/17
to jopend...@googlegroups.com
Hi,

"int" is not a range... A1:C6 is.

Regards,
Guillaume

--

---
You received this message because you are subscribed to the Google Groups "jOpenDocument" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jopendocument+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sylvain Cuaz

unread,
Apr 12, 2017, 4:17:38 AM4/12/17
to jopend...@googlegroups.com
Le 11/04/2017 à 08:33, rho...@opentrends.net a écrit :
> Hi, I have defined a named range in my libreoffice ods, but neither getRange nor getTableModel seem
> to get it, they both return null, do you know what could cause that behavior?

Hi, from your screenshot it appears you have created a database range not a named range. To name
range, simply replace the coordinates (the text field with "A1:B2") by a name and hit enter. To
manage names open the combobox.

> System.out.println(String.valueOf(sheetInfo.getSpreadSheet().getRange("int")));

Be aware that there's sheet ranges and global ranges, the former is returned by Sheet.getRange() the
latter by SpreadSheet.getRange().

Cheers,
Sylvain
Reply all
Reply to author
Forward
0 new messages