Export data to OpenOffice Calc and MS Office Excel

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Export data to OpenOffice Calc and MS Office Excel

Post by Javier Tovar »

Hi Marek,

In Mexico where I'm using MSExcel 99%, and in fact I have never seen a machine with OpenOffice, so I'm very interested in the shows that you could make MSExcel.

regards
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Export data to OpenOffice Calc and MS Office Excel

Post by mol »

All of MS Excel are licenced? Its' almost impossible to use pirate versions on business computers in Poland.
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Export data to OpenOffice Calc and MS Office Excel

Post by Javier Tovar »

In Mexico it is the same, only used under license MSExcel in the business or business.



Greetings.
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Export data to OpenOffice Calc and MS Office Excel

Post by mol »

In 99%, business use M$ Office,against their big prices :-(
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Export data to OpenOffice Calc and MS Office Excel

Post by Rathinagiri »

LibreOffice is definitely a good alternative to Excel.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Export data to OpenOffice Calc and MS Office Excel

Post by Javier Tovar »

If it is an alternative, but most people have Excel and I have acoplarme to what customers have !, If it is presented OpenOficce always negative, because with long careers Excel.

It is my humble opinion,

regards
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Export data to OpenOffice Calc and MS Office Excel

Post by mol »

I'm using Open/Libreoffice from long time (version 1.0).
It's quite good and enough for my requests.
I'm preferring it, because it's free and legal.
User avatar
dragancesu
Posts: 921
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: Export data to OpenOffice Calc and MS Office Excel

Post by dragancesu »

Excel and OpenOffice have their advantages

Excel is standard and better documented, so the data transmission via OLE better because there are possibilities of formatting (it can safely and for openoffice but I have not found)

The only advantage is that OpenOffice can create (Save as) DBF files, ms office >= 2007 to not be (as it is normally used dbf format)
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Export data to OpenOffice Calc and MS Office Excel

Post by mol »

dragancesu wrote:Excel and OpenOffice have their advantages

Excel is standard and better documented, so the data transmission via OLE better because there are possibilities of formatting (it can safely and for openoffice but I have not found)

The only advantage is that OpenOffice can create (Save as) DBF files, ms office >= 2007 to not be (as it is normally used dbf format)
You can format data in OpenOffice:
Eg. Set horizontal justify to right

Code: Select all

oSheet:getCellRangeByPosition(nFirstCol, nFirstRow, nLastCol, nLastRow):HoriJustify := 3
set number format - here for percents:

Code: Select all

oSheet:getCellRangeByPosition(nFirstCol, nFirstRow, nLastCol, nLastRow):NumberFormat:=10
Set optimal column width:

Code: Select all

oColumns:getByIndex(nColIndex):setPropertyValue("OptimalWidth", .T.)
Set column width:

Code: Select all

oColumns:getByIndex(nColIndex):setPropertyValue("Width", 500)	// 0.5 mm
Format page:

Code: Select all

		StyleFamilies = oDocument:StyleFamilies
		PageStyles = StyleFamilies:getByName("PageStyles")
		DefPage = PageStyles:getByName("Default")
		 
		DefPage:LeftMargin = nLeftmargin
		DefPage:RightMargin = nRightMargin
		DefPage:TopMargin = nTopMargin
		DefPage:BottomMargin = nBottomMargin
		DefPage:IsLandscape = lHorizontalOrientation
		DefPage:Width = nPageWidth
		DefPage:Height = npageHeight
		DefPage:HeaderIsOn = lHeaderIsVisible
		DefPage:FooterIsOn = lFooterIsVisible


Set font to BOLD and set color of cell:

Code: Select all

oSheet:Cells(nRow, nCol):Font:Bold := .T.
oSheet:Cells(nRow, nCol):Font:Color :=  RGB( 0, 0, 255 )	// red
User avatar
dragancesu
Posts: 921
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: Export data to OpenOffice Calc and MS Office Excel

Post by dragancesu »

Thank you very much Mol
Post Reply