[Solved] Acquiring the Data in tablegrid and loop it

Creating a macro - Writing a Script - Using the API

[Solved] Acquiring the Data in tablegrid and loop it

Postby ouchd'greyt » Thu Jul 27, 2017 6:01 am

Hi,

Thank you for kindness response, i appreciated it,
I do alternative way on how to appear the selected data from the table grid to my record cell, when the push button get push its label will also change (ex: the label of push button is "item 1" after pressing the button the selected data will transfer/appear to my record cell then the push button label will now change to "item 2" and so on and so forth).


But, i will also try your code, to know what would happen.

Thanks very much!
Last edited by ouchd'greyt on Mon Jul 31, 2017 5:44 am, edited 1 time in total.
OpenOffice 4.1.2 on Windows 7
ouchd'greyt
 
Posts: 26
Joined: Wed Jun 28, 2017 4:41 am

Re: [Writer] Aquiring the Data in tablegrid and loop it

Postby UnklDonald418 » Sat Jul 29, 2017 5:00 pm

What happens if you set a Breakpoint and single step through your macro?
Does it then work correctly, or is the macro firing 3 times?
If you upload a sample file so we can see what is happening, then maybe someone can help.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the subject line
Apache OpenOffice 4.1.3 - Windows 10 Professional
UnklDonald418
Volunteer
 
Posts: 516
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: [Writer] Aquiring the Data in tablegrid and loop it

Postby Villeroy » Sat Jul 29, 2017 7:38 pm

Writer:
tbl = ThisComponent.TextTables.getByName("Table 1")

Calc:
tbl = ThisComponent.Sheets.getByIndex(0).getCellRangeByName("A1:C99")

Both:
a() = tbl.getDataArray()

Now you have a nested array of row arrays in variable a.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 16.04, OpenOffice 4.x & LibreOffice 5.x
User avatar
Villeroy
Volunteer
 
Posts: 24077
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 12 guests