Bug 37767 - Broken DataPilot refresh from basic macros
Summary: Broken DataPilot refresh from basic macros
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
(earliest affected)
3.4.0 release
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Kohei Yoshida
Whiteboard: target:3.4.2
Depends on:
Reported: 2011-05-30 13:49 UTC by aironmail
Modified: 2011-07-18 09:04 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:
Regression By:

small test document to demonstrate the bug. (11.38 KB, application/vnd.oasis.opendocument.spreadsheet)
2011-07-14 13:11 UTC, Kohei Yoshida

Note You need to log in before you can comment on or make changes to this bug.
Description aironmail 2011-05-30 13:49:30 UTC
I have created a Calc document where I place a button (Form Control) encharged of refreshing all existing DataPilots in all existing sheets.

So I associate a macro to the action event of the button. The macro does something like the following:

sheet = thisComponent.Sheets.getByName("Sheet1")
dp = sheet.DataPilotTables.getByIndex(0)

In fact, I do I couple of For Loops, where I get all sheets and all DataPilots by their indexes. But it's not important for this.

The thing is that the dp.refresh() does nothing on LibreOffice 3.4 RC2. I have tried this code on OpenOffice 3.3 and it works nicely. So, apparently something has been broken on the latest builds.

I hope this helps.

Any workaround is wellcome. Thanks in advance.
Comment 1 aironmail 2011-05-30 13:51:16 UTC
I forgot to add that I tried it on a x86 machine on Windows XP SP3.
Comment 2 Oliver Brinzing 2011-05-31 09:51:20 UTC
Comment 3 Rainer Bielefeld Retired 2011-06-10 02:57:23 UTC
RC2 is bit by bit identical with release version, so separate items in the version picker are useless. Changes have been discussed with Michael Meeks.
Comment 4 aironmail 2011-06-27 03:08:05 UTC
Yes, the problem persist on 3.4.1 rcX. Is there any chance for a workaround until an official fix is done? I have several spreadsheets making use of this function.

I've seen that DataPilots in 3.4.x have been renamed to PivotTables but I don't know if that have been also done for macros, invalidating the sheet.DataPilotTables entry. I mean, is sheet.PivotTables.getByIndex(0) going to work as a replacement to shhet.DataPilotTables.getByIndex(0)? Because that would break the compatibility with older LO and OO versions.

Thanks in advance.
Comment 5 Kohei Yoshida 2011-07-07 09:40:31 UTC
Let me take a look at this for 3.4.2 if I can make it.  If not, for the next minor release.
Comment 6 Kohei Yoshida 2011-07-14 13:11:01 UTC
Created attachment 49106 [details]
small test document to demonstrate the bug.

I just created this small sample document just to make it easier for us to test.
Comment 7 Michael Meeks 2011-07-18 08:37:43 UTC
The fix is pushed to master libreoffice-3-4 and will be in 3.4.2 final.

Thanks ! :-)
Comment 8 aironmail 2011-07-18 09:04:29 UTC
Thank you very much for the fix. You're great.