473,320 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

CASE STUDY: generating Microsoft Word Documents on a server

MMcCarthy
14,534 Expert Mod 8TB
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 8284
Motoma
3,237 Expert 2GB
Trying to get someone else to do your job for you, eh Mary?
Oct 5 '07 #2
MMcCarthy
14,534 Expert Mod 8TB
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 Expert 2GB
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 Expert Mod 8TB
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 Expert 2GB
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 Expert Mod 8TB
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 Expert Mod 4TB
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 Expert 2GB
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 Expert Mod 4TB
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 Expert Mod 8TB
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 Expert 2GB
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 Expert Mod 8TB
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 8TB
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 Expert 2GB
Crystal Reports can generate word documents too, I believe.
Oct 18 '07 #15
Kabyr
29
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 100+
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 100+
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 Expert Mod 8TB
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
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
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
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
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
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
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
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
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
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
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
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
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.