Bug 50866 - Macros: Macro to set filter in Calc does not work with .NumericValue
Summary: Macros: Macro to set filter in Calc does not work with .NumericValue
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
3.5.3 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-07 20:00 UTC by u2nBz
Modified: 2015-09-04 03:02 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 u2nBz 2012-06-07 20:00:51 UTC
The following standard method of filtering a named range in Calc has worked for years in OO, and still does. In LO, however, the entire range is filtered out, no matter what numeric value is entered ("38" in example below).

Filtering manually works great.

oDBRange = oDoc.DatabaseRanges.getByName("DB_Range_Name")
oDBRange.UseFilterCriteriaSource = False
oFD = oDBRange.getFilterDescriptor()
oField = createUnoStruct("com.sun.star.sheet.TableFilterField")
With oField
  .Field = 0
  .Operator = com.sun.star.sheet.FilterOperator.EQUAL
  .isNumeric = True
  .NumericValue = 38
End With
oFD.setFilterFields(Array(oField))
oDBRange.refresh()

Possibly related to bug 46983.
Comment 1 Buovjaga 2014-11-06 10:32:06 UTC
Can you give me more detailed steps to reproduce (if this is still a problem)?
I did Insert - Define - Name for row selection with numbers, including 38. I named it range.

Then I had to modify the macro like this:

Sub Rangetest
oNamedRanges = ThisComponent.NamedRanges
oNamedRange = oNamedRanges.getByName("range")
oNamedRange.UseFilterCriteriaSource = False
oFD = oNamedRange.getFilterDescriptor()
oField = createUnoStruct("com.sun.star.sheet.TableFilterField")
With oField
  .Field = 0
  .Operator = com.sun.star.sheet.FilterOperator.EQUAL
  .isNumeric = True
  .NumericValue = 38
End With
oFD.setFilterFields(Array(oField))
oNamedRange.refresh()
End Sub

It refuses to run. It doesn't seem to be finding the range by name, highlighting the getByName line while giving the error:
Type: com.sun.star.container.NoSuchElementException

Tested on Win 7 64-bit Version: 4.4.0.0.alpha1+
Build ID: 8b21b5cbe78945b27525b4ce78ae3d981f90590f
TinderBox: Win-x86@39, Branch:master, Time: 2014-11-06_03:55:51
Comment 2 Alex Thurgood 2015-01-03 17:39:48 UTC
Adding self to CC if not already on
Comment 3 QA Administrators 2015-07-18 17:36:46 UTC
Dear Bug Submitter,

This bug has been in NEEDINFO status with no change for at least 6 months. Please provide the requested information as soon as possible and mark the bug as UNCONFIRMED. Due to regular bug tracker maintenance, if the bug is still in NEEDINFO status with no change in 30 days the QA team will close the bug as INVALID due to lack of needed information.

For more information about our NEEDINFO policy please read the wiki located here: 
https://wiki.documentfoundation.org/QA/FDO/NEEDINFO

If you have already provided the requested information, please mark the bug as UNCONFIRMED so that the QA team knows that the bug is ready to be confirmed.


Thank you for helping us make LibreOffice even better for everyone!


Warm Regards,
QA Team

This NEEDINFO message was generated on: 2015-07-18
Comment 4 Buovjaga 2015-07-20 18:14:16 UTC
NEEDINFO, while we wait for answer to comment 1.
Comment 5 QA Administrators 2015-09-04 03:02:00 UTC
Dear Bug Submitter,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INVALID due to inactivity and a lack of information which is needed in order to accurately reproduce and confirm the problem. We encourage you to retest your bug against the latest release. If the issue is still present in the latest stable release, we need the following information (please ignore any that you've already provided):

a) Provide details of your system including your operating system and the latest version of LibreOffice that you have confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED and we will attempt to reproduce the issue. 
Please do not:
a) respond via email 
b) update the version field in the bug or any of the other details on the top section of FDO
Message generated on: 2015-09-03