Pyuno setDataArray() anyone knows how it works?

I want to copy the content of a csv table into a tab of my .ods file
Of course you first want to try

targetrange.setDataArray(sourcerange.getDataArray())

Of course as with any FOSS thing it just don’t work (getDataArray seems to be incompatible with setDataArray… )

Never mind you try manually:

desktop = XSCRIPTCONTEXT.getDesktop()
sheet=docresult.getSheets().getByName("bitch")
targetrange=sheet.getCellRangeByPosition(1,1,4,1)


targetrange.setDataArray(uno.ByteSequence ("((5.,),(6.,),(7.,))"))
#Not working "Conversion not possible!"

targetrange.setDataArray(("((5.,),(6.,),(7.,))"))
#Not working "Conversion not possible!"

targetrange.setDataArray("((5.,),(6.,),(7.,))")
#Not working "Conversion not possilbe!"


targetrange=sheet.getCellRangeByPosition(1,1,3,3)
targetrange.setDataArray(("((5.,),(6.,),(7.,))"),("((5.,),(6.,),(7.,))"),("((5.,),(6.,),(7.,))"))
#Incorrect number of parameters passed invoking function setDataArray#

targetrange=sheet.getCellRangeByPosition(1,1,4,4)
targetrange.setDataArray(("((5.,),(6.,),(7.,))"),("((5.,),(6.,),(7.,))"),("((5.,),(6.,),(7.,))"))
#Incorrect number of parameters passed invoking function setDataArray#


targetrange=sheet.getCellRangeByPosition(1,1,4,4)
targetrange.setDataArray(((5.,),(6.,),(7.,)),((5.,),(6.,),(7.,)),((5.,),(6.,),(7.,)))
#Incorrect number of parameters passed invoking function setDataArray#

targetrange=sheet.getCellRangeByPosition(1,1,4,4)
targetrange.setDataArray(((5.0,),(6.0,),(7.0,)),((5.0,),(6.0,),(7.0,)),((5.0,),(6.0,),(7.0,)))
#Incorrect number of parameters passed invoking function setDataArray#

targetrange=sheet.getCellRangeByPosition(1,1,3,3)
targetrange.setDataArray(((5.0,),(6.0,),(7.0,)),((5.0,),(6.0,),(7.0,)),((5.0,),(6.0,),(7.0,)))
#Incorrect number of parameters passed invoking function setDataArray#

And lots of other things

And you see how it successfully never works.
Any idea and any help welcome…

May I thanks btw, the comprehensive, extensive and amazingly well written API docu

Your writing Code by 'rolling an Armandillo over the Keyboard !?

Hallo

targetrange= sheet.getCellRangeByPosition(1,1,4,4)
targetrange.setDataArray( ( (5, 6, 7, 8),
                            (1, 2, 3, 4),
                            ('a','b','c','d'),
                            (42, '','','') ) )

If you want to convert .csv - Data to a Calc-DataArray you should ‘import csv’ …