Why we use Open Office
Increasingly our customers are asking us for a quick and easy way to export the data they select and see in our Plex-XML web applications into a format they can use with their locally installed desktop applications.
We think that we will not be able to develop a solution for all the different desktop software formats by ourselves. There are and will be too many different file formats out there. But in order to fulfill most of these demands we have decided to use OpenOffice to do this job for us.
In our Plex-XML framework we are generating XML data as a response to a client request. Then we are using XSLT to convert the XML into HTML. This HTML is shown as a web page in a browser to the user.
From now on we are able to convert the XML response from the server into an OpenOffice spreadsheet format (.ods) as well. The resulting ods file is still an XML format. This ods file is handed over to a server side installed OpenOffice. The ods file will then be converted by OpenOffice into the format the user has selected within the web-application.
The work flow for the user looks like this:
- Select the data you need in the web application. For example all customers living in Italy.
- Press the XLS or PDF button
- Get exactly the same data you have seen in the HTML screen converted into the desktop file format you asked for.
- While receiving the file the desktop application (e.g. Office or the Acrobat Reader) will open automatically and you are ready to work with that file.
For some configurations we use OpenOffice as a service to create PDF/Excel and so on. So here is a little HOWTO
- Install OpenOffice and start it at least one time.
- Download and install the Windows Server 2003 Resource Kit Tools
- Read how to create an own service
- create your service named "OpenOfficeUnoServer" or whatever you want as the name
- run "<Path>\INSTSRV.EXE OpenOfficeUnoServer <Path>\SRVANY.EXE" where <Path> is the Path to the Resource Kit Tools
- Edit the registry Keys :
- create a key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\OpenOfficeUnoServer\Parameters
- add there an entry "AppDirectory" with a value of the installation directory of OpenOffice eg. "C:\Program Files\OpenOffice.org 2.0\program\"
- add an Entry "Application" with following Value "AppDirectory from step 2\soffice.exe -headless -accept=socket,host=0.0.0.0,port=9000;urp;"
- the port should correspond to the one in web.xml
- Disable the license dialog of OpenOffice
- edit <AppDirectory>\share\registry\data\org\openoffice\Setup.xcu (for OOo 3 <AppDirectory>\Basis\share\registry\data\org\openoffice\Setup.xcu) and replace
<prop oor:name="ooSetupInstCompleted"> <value>false</value> </prop> <prop oor:name="ooSetupShowIntro"> <value>true</value> </prop>
<prop oor:name="ooSetupInstCompleted" oor:type="xs:boolean"> <value>true</value> </prop> <prop oor:name="LicenseAcceptDate" oor:type="xs:string"> <value>yyyy-MM-ddThh:mm:ss</value> </prop> <prop oor:name="FirstStartWizardCompleted" oor:type="xs:boolean"> <value>true</value> </prop>
where the timestamp should be later than the installation of OpenOffice
64 Bit Vista
Replace step 3. and 4 with the command:
sc create "OpenOfficeUnoServer" start= auto binpath= "C:\<Path>\srvany.exe"
- The spaces after "=" are not optional!
- srvany.exe is part of the Windows Server 2003 Resource Kit Tools
MAC OS X
/Applications/OpenOffice.org.app/Contents/MacOS/soffice.bin -headless -nofirststartwizard -accept="socket,host=localhost,port=9000;urp;StarOffice.Service"