Solved

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

Posted on 2007-04-04
6
1,693 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 29

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 29

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

617 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