[ Pannello di Controllo Moderatore ]
import uno
import unohelper
def prova():
doc = XSCRIPTCONTEXT.getDocument()
active_sheet = doc.CurrentController.ActiveSheet
cell1 = active_sheet.getCellRangeByName("B1")
cell1.String = "Hello world"
aa = active_sheet.getCellRangeByName("A1").String
active_sheet.getCellRangeByName("A2").String = aa
g_exportedScripts = prova,
g_exportedScripts = prova,
def myFunction(*args):
....
from com.sun.star.awt import Rectangle
from com.sun.star.chart.ChartDataCaption import VALUE
from com.sun.star.chart.ChartDataRowSource import COLUMNS
def CreateChart(event=None):
doc = XSCRIPTCONTEXT.getDocument()
sName = "ADP_Chart"
sDataRng = "A1:B6"
oSheet = doc.Sheets.getByIndex(0) # con le ultime versioni di LibreOffice si può anche scrivere: doc.Sheets[0]
oAddress = oSheet.getCellRangeByName(sDataRng).getRangeAddress()
oCharts = oSheet.getCharts()
if not oCharts.hasByName(sName):
# si può anche scrivere così: oRect = Rectangle(10000, 1000, 10000, 10000)
oRect = Rectangle()
oRect.X = 10000
oRect.Y = 1000
oRect.Width = 10000
oRect.Height= 10000
# The rectangle identifies the dimensions in 1/100 mm.
# The address is the location of the data.
# True indicates that column headings should be used.
# False indicates that Row headings should not be used.
oCharts.addNewByName(sName, oRect, (oAddress,), True, False)
oChart = oCharts.getByName(sName)
oChart.setRanges((oAddress,))
oChartDoc = oChart.getEmbeddedObject()
# oChartDoc.attachData(oAddress)
oTitle = oChartDoc.getTitle()
oTitle.String = "Andy - " #& Now
# Create a diagram.
oDiagram = oChartDoc.createInstance("com.sun.star.chart.XYDiagram")
oChartDoc.setDiagram(oDiagram)
oDiagram = oChartDoc.getDiagram()
oDiagram.DataCaption = VALUE
oDiagram.DataRowSource = COLUMNS
patel ha scritto:nella finestra di errore mi viene segnalato il numero di linea che però non posso vedere su notepad e neppure su wordpad, che fare ?
patel ha scritto:dove trovo i nomi dei moduli da importare e la descrizione ?
Visitano il forum: Nessuno e 4 ospiti