Re: Export data to OpenOffice Calc and MS Office Excel
Posted: Fri Oct 26, 2018 5:20 pm
Do anybody knows how to change font size and font name while exporting data to openoffice sheet?
Exclusive forum for HMG, a Free / Open Source xBase WIN32/64 Bits / GUI Development System
http://hmgforum.com/
Code: Select all
nFontSize := 22
nFontName := "ARIAL"
oSheet:getCellRangeByPosition(1,1,1,2):CharHeight := nFontSize
oSheet:getCellRangeByPosition(1,1,1,2):CharFontName := nFontName
Code: Select all
oSheet:getCellRangeByPosition(1,1,1,2):CharWeight := 150 // percent of font weight --- BOLD ==> "com.sun.star.awt.FontWeight.BOLD"
Code: Select all
oSheet:getCellByPosition(0,i):CharUnderline := nLineType
Code: Select all
oSheet:getCellByPosition(0,i):CharPosture := nFontSlant
Code: Select all
function test1
begin sequence with { |e| break(e)}
oServiceManager := TOleAuto():New("com.sun.star.ServiceManager")
oDesktop := oServiceManager:createInstance("com.sun.star.frame.Desktop")
recover using e
oDeskTop := NIL
end sequence
IF oDesktop = NIL
MsgStop("OpenOffice not installed?","Error")
RETURN Nil
ENDIF
oDocument := oDesktop:loadComponentFromURL("private:factory/scalc","_blank", 0, {})
oSchedule := oDocument:GetSheets()
oSheet := oSchedule:GetByIndex(0)
for i:=0 to 100
c := "Line: "+str(i,3)
oSheet:getCellByPosition(0,i):SetString( c )
next i
for i:=0 to 10
oSheet:getCellByPosition(0,i):CharUnderline := i
next i
return