We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question

Base grid change datafield name

asked 2015-08-12 16:20:10 +0200

Ratslinger gravatar image

updated 2020-08-31 00:32:48 +0200

Alex Kemp gravatar image

Using a macro, I want to change the data displayed in a grid column from one table field to a different field of the same table.

This was working fine in version 4.2.8.x with the following code:

oForm = ThisComponent.Drawpage.Forms.getByName("MainForm") 
oField = oForm.getByName("TestTable")
oColumn = oField.getByName("FormattedField1")
oColumn.DataField = "MONTH3INFO"
oColumn.Label = "MONTH3INFO"
oColumn.Name = "MONTH3INFO"

I recently found out this version was ending its' life cycle so I upgraded to v5.0.0.5 and most of my code works fine except for this particular piece. It is a critical part of the system design and I haven't figured out a way around it.

I receive no errors, the Label, Name and DataField all change properly (used MRI) but the data never changes. However checking BoundField (read only) I see it is still pointing to the previous data field.

I have also gone back and tried v4.4.5.2 and the results were the same.

Finally, I reloaded 4.2.8.x and again the code worked correctly.

Any ideas on how to get this working again will be greatly appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2016-03-07 06:42:43 +0200

Ratslinger gravatar image

It's a bug in Base. Filed Bug report. Problem is with Reload(). Workaround is Unload() then Load().

edit flag offensive delete link more


Problem has been resolved via Bug report #93403. It is scheduled to be included in LO v5.1.4

Ratslinger gravatar imageRatslinger ( 2016-05-31 18:55:06 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-08-12 16:20:10 +0200

Seen: 209 times

Last updated: Mar 07 '16