Export to Excel

This forum is for eXpress++ general support.
Post Reply
Message
Author
omni
Posts: 554
Joined: Thu Jan 28, 2010 9:34 am

Export to Excel

#1 Post by omni »

Roger,

we have a large client that (due to remote users and licensing issues) wants to open files in a spreadsheet with Openoffice instead of excel.

Do we have a method to do this, or one you can suggest? (ie, would runshell work with the file name as the option, something like that)

Thanks

Fred
Omni

User avatar
Auge_Ohr
Posts: 1428
Joined: Wed Feb 24, 2010 3:44 pm

Re: Export to Excel

#2 Post by Auge_Ohr »

hi,

do you mean activeX ?

Code: Select all

oServiceManager := CreateObject("com.sun.star.ServiceManager")
while OpenOffice use a Array for Parameter you must use something like this

Code: Select all

oHidden := MakeProperty( "Hidden", TRUE )
LoadArgs := VTType():New( {oHidden}, VT_ARRAY+VT_VARIANT )
you also need to use CoreReflection Class to create Structure

Code: Select all

oCoreReflection := oServiceManager:createInstance("com.sun.star.reflection.CoreReflection")
and create a new Instance

Code: Select all

oDesktop := oServiceManager:createInstanceWithArguments("com.sun.star.frame.Desktop", LoadArgs )
before you can load a empty Sheet

Code: Select all

oDocument := oDesktop:loadComponentFromURL("private:factory/swriter", "_blank", 0, LoadArgs )
and begin to fill it.
greetings by OHR
Jimmy

bwolfsohn
Posts: 649
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: Export to Excel

#3 Post by bwolfsohn »

omni wrote:Roger,

we have a large client that (due to remote users and licensing issues) wants to open files in a spreadsheet with Openoffice instead of excel.

Do we have a method to do this, or one you can suggest? (ie, would runshell work with the file name as the option, something like that)

Thanks

Fred
Omni
Fred,

If you have your file associations set to open office, it will work...

you can test it on one of their machines by just typing in the file name at a dos prompt after changing file associations.
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

omni
Posts: 554
Joined: Thu Jan 28, 2010 9:34 am

Re: Export to Excel

#4 Post by omni »

Not sure I was clear..

we are using excel1.prg (from Rogers example, slightly revised) to open dbf files in excel. We have a couple dozen that are on the menu for some specific reports, or they can export any database from our database list on one of the menu options.
We check to be sure excel is installed first, so the remote users cannot get past that because they have openoffice instead.
So, can the excel program be changed to just use openoffice instead, or do we need to use the options that Augie suggested, which without some review, is more than I know about openoffice. Or is there another option that may be used.


Thanks

Fred

bwolfsohn
Posts: 649
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: Export to Excel

#5 Post by bwolfsohn »

Fred,

A couple of points:
1. If a file can be opened in excel 2003 or earlier, it can be opened in openoffice. i use openoffice myself. the files are interchangeable as long as they are saved in .xls format. i do not know about office 2007 or office 2010.

2. The roadblock seems to be in the function checking for excel. that function needs to be changed to check for either excel or openoffice. then, if you were using runshell before (sending only the filename.xls), you should not have to change it.

3. I'm not sure what you mean by: "So, can the excel program be changed to just use openoffice".

If you are creating an excel file from express, and saving it as a .xls file, you s/b good to go.. if you are using activex to interactively do "stuff", then i don't have a clue...

i hope this helps..
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

omni
Posts: 554
Joined: Thu Jan 28, 2010 9:34 am

Re: Export to Excel

#6 Post by omni »

We are opening a dbf file and saving as an xls file. In our initial testing today we can open a file just by typing in "scalc file.dbf" and it opens (with proper paths for each). There is only a prompt for character set, which is the default that comes up. We can handle that...openoffice says that the charset option is not available to define in their docs. So, that we can do but will let the user pick the save file name, unless they have an option for that..have not gotten that far yet.

Next question relates to the method used to extrapulate the columns for reports and put them in a spreadsheet (like printopt does). Any thoughts if that can work at all..anybody?


Fred

bwolfsohn
Posts: 649
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: Export to Excel

#7 Post by bwolfsohn »

Fred,

I think you meant to type scalc file.xls instead of scalc file.dbf..

once you set the file association for .xls to open office scalc, you should be able to just type file.xls and it should open.

if open office has been installed properly, the file association should already be set.

in your program, you should be able to do a runshell with the full path and filename of the .xls file.. i.e.
c:\temp\file.xls

hth
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

Post Reply