Solved

How to create OpenOffice Calc document programmatically (C++)?

Posted on 2007-04-04
6
1,622 Views
Last Modified: 2013-12-27
Hi,

I am using Microsoft Visual C++ 8 (VS 2005) and I need to create OpenOffice Calc document programmatically from inside my C++ application. Is there any short example/tutorial?

Thanks.
0
Comment
Question by:pepr
6 Comments
 
LVL 6

Assisted Solution

by:bijopuli
bijopuli earned 150 total points
ID: 18851134
Hi

This will be a great resource:

http://udk.openoffice.org/common/man/spec/ole_bridge.html

Regards
Bijo.
0
 
LVL 17

Assisted Solution

by:rstaveley
rstaveley earned 100 total points
ID: 18851228
MS Office automation is generally called upon for MS Excel on Windows platforms and it looks like you can automate OOo likewise - see http://udk.openoffice.org/common/man/tutorial/office_automation.html and follow the link to the StarOffice programmer's tutorial - but you're on your own there as far as I'm concerned.

I can vouch that HSSF does a great job of it in Java - see http://jakarta.apache.org/poi/hssf/index.html.

Otherwise, OOo is open source, which means you ought to be able to dig around in it, but that's unlikely to be quick gratification.
0
 
LVL 86

Accepted Solution

by:
jkr earned 250 total points
ID: 18851715
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 28

Author Comment

by:pepr
ID: 18897701
Thanks to all. Sorry for being late with my reaction. However, I am fighting with it without success. Is there any step-by-step tutorial what should be done from scratch? I am not able to make the thinks working.

I have downloaded and installed the OpenOffice 2.2 (stable) for Windows as OOo_2.2.0_Win32Intel_install_en-US.exe. The applications work fine (at least it seems so).

Then I have downloaded SDK instalation pack as OOo-SDK_2.2.0_Win32Intel_install.exe and installed it. Then I tried to run "C:\Program Files\OpenOffice.org_2.2_SDK\setsdkenv_windows.bat" to set the environment. Then I have noticed that I probably need URE (UNO Runtime Environment).

So, I have downloaded OOo-URE_1.2_windows_install_en-US.exe and installed. Then I forced the
"C:\Program Files\OpenOffice.org_2.2_SDK\setsdkenv_windows.bat --force-configure". When runnig the batch again now, it reports:

Setting environment for using Microsoft Visual Studio 2005 x86 tools.

 ******************************************************************
 *
 * SDK environment is prepared for Windows
 *
 * SDK = C:\Program Files\OpenOffice.org_2.2_SDK
 * Office =
 * URE = C:\Program Files\URE
 * Make = c:\cygwin\bin
 * Zip = d:\usr\bin
 * C++ Compiler = C:\Program Files\Microsoft Visual Studio 8\VC\bin
 * C# and VB.NET compilers = C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
 * Java =
 * Special Output directory = c:\tmp
 * Auto deployment = NO
 *
 ******************************************************************

I am not sure about some of the settings. For example, the batch wanted directories but maybe it wanted full paths to the tools? Another problem, C# and VB.NET is not inside the directory, but I guess that I do not need them for C++.

When running make (from cygwin) for the example disussed in document pointed by jkr, the result looks like this:

C:\...xamples\DevelopersGuide\ProfUNO\CppBinding>make
/bin/sh: ../../../../config.guess: No such file or directory
mkdir ..\\..\\..\\..\\WINexample.out\\inc\\ProfUnoCppBinding\\com\\sun\\star\\uno
mkdir: cannot create directory `..\\..\\..\\..\\WINexample.out\\inc\\ProfUnoCppBinding\\com\\sun\\star\\uno': No such file or directory
make: [../../../../WINexample.out/inc/ProfUnoCppBinding/com/sun/star/uno/XNamingService.hpp] Error 1 (ignored)
"/windows/bin/cppumaker" -Gc -BUCR -O../../../../WINexample.out/inc/ProfUnoCppBinding -Tcom.sun.star
.uno.XNamingService -Tcom.sun.star.uno.XComponentContext -Tcom.sun.star.uno.XWeak -Tcom.sun.star.uno
.XAggregation -Tcom.sun.star.lang.XMain -Tcom.sun.star.lang.XMultiServiceFactory -Tcom.sun.star.lang
.XSingleComponentFactory -Tcom.sun.star.lang.XTypeProvider -Tcom.sun.star.lang.XComponent -Tcom.sun.
star.registry.XSimpleRegistry -Tcom.sun.star.registry.XImplementationRegistration -Tcom.sun.star.bri
dge.XBridgeFactory -Tcom.sun.star.bridge.XUnoUrlResolver -Tcom.sun.star.container.XHierarchicalNameA
ccess "\types.rdb"
/bin/sh: /windows/bin/cppumaker: No such file or directory
make: *** [../../../../WINexample.out/inc/ProfUnoCppBinding/com/sun/star/uno/XNamingService.hpp] Err
or 127

I do not know, for example, if the things could be done in C++ without UNO (URE), and what should be the /windows/bin/cppumaker.

Any other hint?

Thanks
0
 
LVL 28

Author Comment

by:pepr
ID: 18995223
I have assigned the point by just feeling who of you is the closer to the answer. I did not try hard enough to solve the problem (postponed). Thanks anyway.
0
 
LVL 17

Expert Comment

by:rstaveley
ID: 18996358
Sorry I missed your post on 12th (I've had my nose to the grindstone), but if you are missing cppumaker, it looks like you haven't installed the Uno SDK or that you've installed the tool somewhere different from \windows\bin.

Here's a link for the SDK download, if and when you pick up the pieces of this project again:

http://download.openoffice.org/2.1.0/sdk.html
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question