Bug 162319 - Allow to rename a database range
Summary: Allow to rename a database range
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-DataRange
  Show dependency treegraph
 
Reported: 2024-08-02 15:00 UTC by Regina Henschel
Modified: 2024-09-05 12:01 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2024-08-02 15:00:42 UTC
Calc has the feature of "database range". It is comparable to "Excel Table". [I think it can even more, e.g. bundled sort and filter. But I'm no Excel expert.]

In Excel it is possible to rename the table very easily: You type the new name into the name field in tab "Table Design". That's all. Excel automatically adapts the formulas, that use the table name.

Such feature is missing in Calc. It is important especially for database ranges with linked content. They get the name "Import1", "Import2" automatically. The user has no way to change it to something more meaningful.

The MRI extension allows to change the name, but does not update the formulas that use that name.

The database range name is used in "structured references".
Comment 1 Rafael Lima 2024-08-02 17:57:23 UTC
Regina, database named ranges are hidden by default from the "Manage names" dialog. See:

https://opengrok.libreoffice.org/xref/core/sc/source/ui/namedlg/namemgrtable.cxx?r=cdb180e7#163

We can see what happens if they're made visible.
Comment 2 Rafael Lima 2024-08-02 17:59:13 UTC
(In reply to Rafael Lima from comment #1)
> We can see what happens if they're made visible.

I meant we can try it and see what happens if they're made visible.

But I can't work on this right now.
Comment 3 Regina Henschel 2024-08-02 21:03:35 UTC
(In reply to Rafael Lima from comment #1)
> Regina, database named ranges are hidden by default from the "Manage names"
> dialog. See:
> 
> https://opengrok.libreoffice.org/xref/core/sc/source/ui/namedlg/namemgrtable.
> cxx?r=cdb180e7#163
> 

I think that is not related. The name in the "Manage names" dialog belongs to the cell area, which is used in "Advanced Filter" to specify the criteria for filtering. If I comment out the test !rEntry.second->HasType(ScRangeData::Type::Database), that does not make the database range name appear in the "Manage names" dialog.

It seems, related is e.g. class ScDBDocFunc. But the RenameDBRange() method defined there is only called in ScDatabaseRangeObj::setName(). That is the UNO method, that is used in MRI. That only changes the name in ScDBData, but does not change the formulas, that use this name.
Comment 4 Jon Tillman 2024-09-05 12:01:54 UTC
Database Ranges are visible from Data > Select Range and can be created via Data > Define Range.

Additionally, they can be edited via Data > Define Range (questionable UI choice?) to change the range covered by the Range, but not the name.

Selecting a range from the list of ranges and typing a new name in the Name box then clicking Modify should, if the current UI is followed, allow for in-place renaming of the range. It does not. 

The only current option is to make a new range exactly the same size as an existing range, give it a meaningful name, then delete the existing range.