473,480 Members | 2,194 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

CASE STUDY: generating Microsoft Word Documents on a server

MMcCarthy
14,534 Recognized Expert Moderator MVP
This problem was proposed to me but not really my area of expertise so I thought I would open it up to the forum to see if anyone had any bright ideas.

The problem is generating Microsoft Word Documents on a server from Word templates and injecting data from a data source. There are a number of solutions to this problem that are less than satisfactory:

1. Use the Microsoft Word Object Model is not good as it requires the installation of a client application on a server and it leaves processes open if you are not really careful.
2. Using WordML is Not great because it's XML and not really word documents.
3. Using HTML is OK but it's HTML not word at the end of the day.
4. Using RTF is same problem.

Requirements:
  1. The documents will be generated on a server, no Word application is installed.
  2. If at all possible the input should be Word documents or Word Template files, so that business users can create them. I will relax this requirement for good alternatives.
  3. The solution should be scalable.
  4. I don't care what technology is used, PHP, Java, .NET?
  5. The solution should work
Oct 5 '07 #1
20 8294
Motoma
3,237 Recognized Expert Specialist
Trying to get someone else to do your job for you, eh Mary?
Oct 5 '07 #2
MMcCarthy
14,534 Recognized Expert Moderator MVP
Trying to get someone else to do your job for you, eh Mary?
LOL! Naw ...

This is just something one of my clients proposed to their IT staff. They asked for my input as well.
Oct 5 '07 #3
Motoma
3,237 Recognized Expert Specialist
Open Office is scriptable; I believe you can set it up to to file conversions without invoking a GUI as you do with MS Office's craptools.
Oct 5 '07 #4
MMcCarthy
14,534 Recognized Expert Moderator MVP
Open Office is scriptable; I believe you can set it up to to file conversions without invoking a GUI as you do with MS Office's craptools.
Thats Sun's version of Office is it?
Oct 5 '07 #5
Motoma
3,237 Recognized Expert Specialist
Thats Sun's version of Office is it?
More or less.
There is OpenOffice, and there is StarOffice, which is Sun's version.
Oct 5 '07 #6
MMcCarthy
14,534 Recognized Expert Moderator MVP
More or less.
There is OpenOffice, and there is StarOffice, which is Sun's version.
I remember star office from many years ago but never actually got exposed to open office.
Oct 6 '07 #7
gits
5,390 Recognized Expert Moderator Expert
hmmm ...

in case you find a solution based on open office you may be interested in the following odf-to-openXML-converter

kind regards
Oct 7 '07 #8
Motoma
3,237 Recognized Expert Specialist
hmmm ...

in case you find a solution based on open office you may be interested in the following odf-to-openXML-converter

kind regards
Well, Open Office can save directly to MS Word Document format, as Mary requested.
Oct 7 '07 #9
gits
5,390 Recognized Expert Moderator Expert
yep ... forget about my post ... but i thought it could be an good idea to produce odf at all ... because of its standardization. and only convert it for word in case you need to ...

i know that ms is trying to get the office openXML standardized as well and i think this might happen otherwise i think they have to use odf too? ... and isn't openXML the format of word-docs too? sorry ... but i shouldn't had said something in a domain where i'm not an expert ...
Oct 7 '07 #10
MMcCarthy
14,534 Recognized Expert Moderator MVP
yep ... forget about my post ... but i thought it could be an good idea to produce odf at all ... because of its standardization. and only convert it for word in case you need to ...

i know that ms is trying to get the office openXML standardized as well and i think this might happen otherwise i think they have to use odf too? ... and isn't openXML the format of word-docs too? sorry ... but i shouldn't had said something in a domain where i'm not an expert ...
This is just a case study gits. All opinions are welcome.
Oct 7 '07 #11
Motoma
3,237 Recognized Expert Specialist
This is just a case study gits. All opinions are welcome.
As gits stated, there are STANDARDIZED formats which I would strongly urge clients to use. Almost all document editors can utilize these formats, as opposed to proprietary formats. Microsoft is really pushing to get its format to be an ISO standard, however they haven't succeeded with that yet.
Oct 9 '07 #12
MMcCarthy
14,534 Recognized Expert Moderator MVP
The client who originally put this problem forward has come up with the following solution.

Apache POI - Java API To Access Microsoft Format Files

Its interesting stuff.
Oct 15 '07 #13
r035198x
13,262 MVP
The client who originally put this problem forward has come up with the following solution.

Apache POI - Java API To Access Microsoft Format Files

Its interesting stuff.
The integration of the template and the database data would range from being a trivial exercise to very complex depending on the complexity of the reports required.

Might as well throw away everything and use ireports. It's easy to design reports on it and create .jasper files which are easily convertible to .doc and .pdf files. The sql will be tied to the report itself and you can make some complicated reports on it.
We are using ireports a lot at work.

Using the poi with Java is very easy of course but there is no mechanism that ties sql queries to the .docs themselves. You'd have to couple them yourself.
Oct 18 '07 #14
Motoma
3,237 Recognized Expert Specialist
Crystal Reports can generate word documents too, I believe.
Oct 18 '07 #15
Kabyr
29 New Member
If you chose not to install Word on your server, why not install it on a client machine, Use OLE to call it up, do your thing and direct the save path to the server.
Nov 4 '07 #16
alpnz
113 New Member
Hi Mary .... I'll have a delve through the linux world ... there are a number of old libraries that could achieve this, or at least managed to convert from word, so surely reversable ... I presume M$SQL pkpk as the data server? although not important ... yes yes I know its been a long time .... my lightship broke down on the return journey ... but I'm back .... :-) xxx
Dec 10 '07 #17
alpnz
113 New Member
yep ... forget about my post ... but i thought it could be an good idea to produce odf at all ... because of its standardization. and only convert it for word in case you need to ...

i know that ms is trying to get the office openXML standardized as well and i think this might happen otherwise i think they have to use odf too? ... and isn't openXML the format of word-docs too? sorry ... but i shouldn't had said something in a domain where i'm not an expert ...
M$ have had a small setback with a number of Govts adopting the odf standard ... guess they finally decided to cut the umbilca ...
Dec 10 '07 #18
MMcCarthy
14,534 Recognized Expert Moderator MVP
Hi Mary .... I'll have a delve through the linux world ... there are a number of old libraries that could achieve this, or at least managed to convert from word, so surely reversable ... I presume M$SQL pkpk as the data server? although not important ... yes yes I know its been a long time .... my lightship broke down on the return journey ... but I'm back .... :-) xxx
Nice to see you back :)

You should get a new lightship, trying to repair those old models is costly and they are not very reliable.

As to the question in hand. I believe they found a solution but please post any information on libraries as you never know who might find this useful in the future.

Mary
Dec 10 '07 #19
akaihola
1 New Member
We did this by using ODF files as templates, processed them in Django with a library we based on a publicly available code snippet.

The resulting ODF file is then processed with a headless OpenOffice process which runs a customized version of a well-known conversion macro.

Many articles on the web show all kinds of trickery needed to run OpenOffice headless on a server with no X environment, but the Headless VCL plugin available in Debian Etch Backports solved that extremely easily for us.
Feb 6 '08 #20
vrpraba
2 New Member
what is u problem.

microsoft word so go create a word obj.

and xml
Feb 14 '08 #21

Sign in to post your reply or Sign up for a free account.

Similar topics

3
8990
by: lee_j | last post by:
Hi, I have a question below. In the Sql server 2000 I store some word documents.Then I get the data from the database through the asp code and display the word document in IE.The ContentType is...
5
20219
by: Rimantas Žukaitis | last post by:
Hi, we are developing server side report generation application with .NET. The problem is, that we have to present same data in diferent formats (HTML, PDF, WORD, EXCEL). This has to be done...
3
1359
by: mark | last post by:
is it possible to open / create word documents in word ? eg open a document and replace text and print ? using asp and vb behind. if so is there any tutorials anywhere ? (heh difficult searching...
10
1898
by: Noor | last post by:
Hi all, I need to well formatted ms word document through vb.net. All the data that will make the word document will come from the database. and formatted dynamically. Currently i have...
2
11429
by: William LaMartin | last post by:
I have created a program that allows for the automation of things in Word documents, like changing the values of DocVariables and the links to Excel Sheets. I did it using interoperoperatability,...
6
5970
by: SivaSiva | last post by:
Hi, I'm getting the following error when I try convert a word document using asp.net. Application Event Log : Detection of product '{90110409-6000-11D3-8CFE-0150048383C9}', feature...
0
1054
by: Anonieko | last post by:
Using Project Template Wizard in New->Project->Extensiblity to create basic Addins. It creates automatically 'For Testing' .addin xml file - to be copied in the C:\Documents and...
6
4601
by: Eric Layman | last post by:
Hi, I have fields from textareas. With a click of a button, php is able to grab these fields and by using header(), convert the output to Ms Word doc. But the outcome of the word doc...
5
2466
by: md9108 | last post by:
I created, using some borrowed code, an asp search page for our intranet. I'm using frontpage 2003. When I publish I get that complation error on different lines at different times. They all seem...
0
7054
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
6756
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5357
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4798
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4495
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3000
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
570
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
199
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.