473,716 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to create completely server side, document merge

I was given the task of designing a complete web based
document prep system. In simplest terms (using a msword
explanation) create a database of merge fields, and a
library of templates. Allow the webuser to select the
template, merge his DB record, and produce a formatted
document that can be printed or downloaded.

We need to do this without specialized software on the
client, since it will be universally available to
webusers. We considered using PDF, but the creation of the
templates were painfully slow, and the datamerge had
severe space limitations (the form could not adequately
adjust for long or short field data). We need it to
function entirely within a webbrowser.

The forms or templates in "phase one" of the roll out will
be text based documents, Simple business forms, contracts,
etc. We will probably have to integrate more highly
developed forms later, such as Gov't Docs etc.

I believe that XML could be my answer

My requirements are that template creation must be doable
by a secretary level user, not a programmer. A lot of cut
and paste. For example, taking txt legal documents,
applying formatting (fonts, margins, tabs, allignments)
and merge fields to the Doc and saving it as a template. I
assume that using Office 2003, we can save a correctly
formatted word doc to XML and put the correct datafield
links in it.

I need confirmation that what I understand "above", is
true AND that it is absolutely attainable. Not in theory
but in Practice.

RIchard Fritzler
Nov 12 '05 #1
3 5387
Yes XML and more precisely XSL is what you want. I recently completed a
system where the user could design a document and place mapped fields within
the document. This was a wysiwyg editor written for IE 6.0. Based on the
documents design the system generated an XSLT transformation document that
would transform the db fields into the document. It is very fast and
efficient and is also very very easy to learn.

Your situation is almost identical and what you need is something like this.

1. Define an XML document that is used when designing documents. The xml
document tells the 'designer' how to map the fields in your database to the
xml representation of that data, as in
<data>
<field externalName="F irst Name" dbfieldMap="use rs.fname"
datatype="varch ar" size="100" xpath="//users/fname"/>
..next field
.. ext
</data>

When the user is typing there document and whish to insert a field into it
they could say click on a button and would see a list of fields where you
would use the enternalName attribute as the display name. When they insert
the field you could display, if using the editing features of IE for example
<span class=xslfld dbFieldMap="use rs.fname">First Name</span>. The user
would only see 'First Name'. When the user chooses to save the document you
parse the document based on the class xslfld and replace it with the
appropriate xsl command. In this case it would be:

<xsl:value-of select="//users/fname"/>

If you are not familiar is xsl it is very easy to learn and exists within
html if you want. Will find information on xsl and xpath at
http://msdn.microsoft.com/library/en...asp?frame=true.
Read up of XML, XPATH and XSL. Probably the most difficult aspect is
learning how schemas work.

2. Define your database data as a standardized xml file that can easily be
retrieve. For example:

<data>
<users fnamedbid="10">
<fname>John</fname>
<lname>Henry</lname>
<workhistory>
<workitem></workitem>
etc..
</workhistory>
</users>

In the above case the table users has a related table called workhistory in
the db where there are multiple workitems stored. It is very important to
understand how to map your database to your xml and make it consistent. One
of the nice things about an implementation of this type is that you can
easily express new data by updating your designer xml document when you
relationships are defined within your db and consequently your data xml
file.

It sounds fairly simple and it is but it can get fairly complex based on the
number of child relationships you have and what sort of formatting you wish
to support within your wysiwyg designer. A single denormalized table is
easy but providing for child relationship formatting can be more difficult.

If you are running against a database with large amount of data you need to
be able to create the data xml file based on criteria. The nice thing is
with some though you can use the 'designer' xml file to define your SQL
statement before getting your data. Like anything else it takes some
tweaking and optimization as you go along but if you plan it out well it can
work like a charm!

Hope this helps

Regards
Keith Chadwick

"Richard Fritzler" <ms********@owe lesstax.com> wrote in message
news:05******** *************** *****@phx.gbl.. .
I was given the task of designing a complete web based
document prep system. In simplest terms (using a msword
explanation) create a database of merge fields, and a
library of templates. Allow the webuser to select the
template, merge his DB record, and produce a formatted
document that can be printed or downloaded.

We need to do this without specialized software on the
client, since it will be universally available to
webusers. We considered using PDF, but the creation of the
templates were painfully slow, and the datamerge had
severe space limitations (the form could not adequately
adjust for long or short field data). We need it to
function entirely within a webbrowser.

The forms or templates in "phase one" of the roll out will
be text based documents, Simple business forms, contracts,
etc. We will probably have to integrate more highly
developed forms later, such as Gov't Docs etc.

I believe that XML could be my answer

My requirements are that template creation must be doable
by a secretary level user, not a programmer. A lot of cut
and paste. For example, taking txt legal documents,
applying formatting (fonts, margins, tabs, allignments)
and merge fields to the Doc and saving it as a template. I
assume that using Office 2003, we can save a correctly
formatted word doc to XML and put the correct datafield
links in it.

I need confirmation that what I understand "above", is
true AND that it is absolutely attainable. Not in theory
but in Practice.

RIchard Fritzler

Nov 12 '05 #2
if your input person is going to be running Word then some thoughst -

these relate to pre Word 2003. If your create in word 2002 or previous and save as web file you will find that you get several outputs including a CSS and htm file. These are not clean. They hold all the w3c standards plus MS own stuff. But they do hold all you eed to collect the formatting styles, fields, headers footers they have used. You will need a process to capture and parse these files to enable loading into a database. Once there pretty straight forward as per previous reply.

Disuade your user from having headers and footers or TOC's. Its too early to use these with reliablity given the variety that users rightly expect. You will have fun with multi page docs if the user is firm on the formatting

*************** *************** *************** *************** **********
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Nov 12 '05 #3
Hi,

Check out XpertDoc at www.XpertDoc.com. I believe this tool fits all
of your requirements:

- Templates are very easy to design and maintain since they are
created directly from within MS-Word.

- No limitations on the MS-Word formatting features that you can use:
Header, footer, tables, footnotes, graphics, etc.

- Safe for operating from a Web site. XpertDoc has its own merging
module, allowing it to generate genuine MS-Word documents without
requiring MS-Word to be installed on the server.

- No special client-side module required. All the users need is
MS-Word or any other software that can read RTF files.

A large HR consulting company currently uses XpertDoc to generate up
to 300 000 documents a month through a Web site accessed by 150 000
users. It really works!

Check it out at www.XpertDoc.com...
greg austin (ga*****@propos alheaven.com) wrote in message news:<up******* *******@TK2MSFT NGP09.phx.gbl>. ..
if your input person is going to be running Word then some thoughst -

these relate to pre Word 2003. If your create in word 2002 or previous and save as web file you will find that you get several
outputs including a CSS and htm file. These are not clean. They hold
all the w3c standards plus MS own stuff. But they do hold all you eed
to collect the formatting styles, fields, headers footers they have
used. You will need a process to capture and parse these files to
enable loading into a database. Once there pretty straight forward as
per previous reply.
Disuade your user from having headers and footers or TOC's. Its too early to use these with reliablity given the variety that users rightly expect. You will have fun with multi page docs if the user is firm on the formatting

*************** *************** *************** *************** **********
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2384
by: lee_j | last post by:
Hi, I want to merge a word document in the server to display in the client side.The merge code is in a dll.In the asp server script, I invoke the dll to merge.It raise an error when I use the default IIS user.When I change the IIS user to administrator,It work well. I don't know how I should do to resolve this problem.Please give me some advice. Thanks! Jack
16
23301
by: datactrl | last post by:
Hi, Is that posible to create a web page completely with javascript and open it without request to server? Please show a simple sample. Thanks in advance! Jack
3
479
by: di | last post by:
I have a Access Database, and I would like to create a word document that (preferable would filter)links to ACCESS table or query. I would like to print the word document on the filtered record that I have selected in Access. for example if I have customer number (201) that I would like to merge over to a Word document. The word document is a template that I would like to use regularly. Thanks so Much for anyone that can WALK me thru...
0
1519
by: Lauren Wilson | last post by:
Hi folks, I am using the following code to merge data from an Access table to a pre-defined Word 2000 merge document. It al works fine except for ONE problem -- after the merged document displays and the user saves it or whatever, then closes it, the actual merge template is displayed in the background and asks if the user wants to save the updated merge document. I do not want the user to even be aware of the merge template at all. ...
3
5583
by: Andy Davis | last post by:
I have set up a mail merge document in Word 2003 which gets its data from my Access 2000 database. I want to set up a button on a form that: 1. runs the query to provide the dat for the merge document in Word; 2. opens the document and runs the merge process for the new data. I have managed to write the code to perform step 1 ok, but I'm having trouble with step 2. It opens the word document fine but does not perform the mail merge of...
2
13532
by: Mikey | last post by:
Sample VB .NET source code to create mailing labels or customized letters using MS Word MailMerge This VB .NET source code will start MS Word and call methods and set properties in MS Word to execute a MailMerge to create mailing labels or customized letters. A label name known to MS Word MailMerge mailing label wizard may be used or a template file containing the field names Line1 thru Line5 for each record to be printed. If a...
2
3376
by: Colin Halliday | last post by:
I have a Word 2003 mail merge main document (form letter) that is linked to another Word document data source for the mail merge. If I open this doc using the Word GUI, it first asks me to confirm that I want to run a query to select the data from the data source file, then it opens the form letter fine. I can preview the merged records and complete a merge to a new document. I have a VB 2006 project (.net framework 2.0) which opens the...
8
2942
by: Franck | last post by:
Hi, I'm lookin for an external tool which could convert any type of documents to pdf from server. (with as much functionnalities as possible : schedule, pooling, multi thread, embedding font, encrypt, merge, ...) (Actually testing neevia Document Convert pro) Does anyone got experience and/or links regarding this ?
2
3339
by: jojopangit | last post by:
hi, i have the following command and generated an error : "word was unable to open the data source" any help will be greatly appreciated. Thanks in advance. Jude Private Sub Command1_Click()
0
8823
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9344
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9105
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9047
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7980
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6647
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4477
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4738
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.