Re: Best option for writing to MS Word
- From: Barry <support@xxxxxxxxxxxxxxxxxxx>
- Date: Sun, 29 Apr 2007 08:57:07 -0600
On Sun, 29 Apr 2007 16:11:45 +0200, "Ivan Rakyta" <rakyta_at_stonline.sk> wrote:
Hi Jerry,
generating word documents using OLE is quite slow, especially when you are
creating tables and selecting, formatting, etc. I remember once I generated
400 pages document and it run for one day.
For our last project we used different approach, we're generating XML, then
converting it using stylesheets to HTML, then open in MS Word to print it.
All documents are stored in database as data and generated when needed, it
takes second or two to generate quite complicated invoice with 10 pages...
If you need word format, you can just save from word using OLE.
It is much faster and you can do very complicated formatting using XSL
stylesheets. Those stylesheets we created by exporting word document to HTML
(Word creates all css) and then manually adding XSL commands inside the
HTML. Results are quite impressive. I tried to do something similar in
Crystal Reports and I gave up - formatting options in Word are much much
better.
Ivan
Ivan,
If the Word files you're generating are not going to be edited by your recipient, then why not
just create PDF files from Delphi? There are PDF components for Delphi that allows you to draw on it
like a Canvas so you can put anything you like on it (lines, images, backgrounds, watermarks etc).
Since the fonts and everything can be embedded in the PDF, and is printable, and everything is
stored in one file, it would be ultra compact. You can also slap on passwords and other security
measures, even publish it on the web. Not everyone has MS Word, or your version of MS Word (not
always backward compatible) and this trend will continue. PDF is a far more universal document
format and is easier to work with. Just my 2 cents. :)
Barry
-----------------------------------
e-mail: support@xxxxxxxxxxxxxxxxxxx
web page: http://www.grebarsys.com
PrintDAT! - Make your grids and tables printable in just 10 seconds & 1 line of code
SuperFastDistinct! - 5x, 10x, 100x faster than SQL's Select Distinct ...
.
- References:
- Best option for writing to MS Word
- From: Jerry Hayes
- Re: Best option for writing to MS Word
- From: Ivan Rakyta
- Best option for writing to MS Word
- Prev by Date: Re: delphi 2007 installation
- Next by Date: Re: delphi 2007 installation
- Previous by thread: Re: Best option for writing to MS Word
- Next by thread: Re: Best option for writing to MS Word
- Index(es):