Solved

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

Posted on 2007-04-04
6
1,669 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

710 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