Solved

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

Posted on 2007-04-04
6
1,652 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
Independent Software Vendors: 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

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…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

756 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