Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
paul paul is offline
external usenet poster
 
Posts: 249
Default Merged Word 2003/2007 document from .NET website & SQL data

Hi there.
I have a .NET 2.0 website with a SQL server backend. I want to allow the
user to select a report that will be generated & downloaded to the user on
the fly. The report will be based on a stored Word template/document. The
template/document will include either content controls or mail merge tags to
be replaced by data from the SQL database.

I can use Word 2003 or 2007.

I have looked at 2007 content controls but these do not seem to allow
repeated content controls for table data. i.e. order lines from an order. The
reports will have a mixture of single fields and some repeated fields in
tables.

Does anyone know of a suitable solution to this problem and any links to
sample code than may be of use?

Thank you for any help offered.
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Merged Word 2003/2007 document from .NET website & SQL data

Word does not really do the parent/child reporting thing - for possible ways
to do it, see e.g.

http://homepage.swissonline.ch/cindy...r/mergfaq1.htm

http://support.microsoft.com/default...b;en-us;211303

Or you can "roll your own" merge, generating the Word document dynamically
using macro code (or possibly, using Word's MailMerge Events, although I
suspect that's a bad idea here). Content controls might help in Word 2007 if
you were able to dynamically alter the XML data that the Content control
references (I haven't worked with these things much so cannot tell you
whether or not that is feasible and how to do it if it is). Your server
could in theory "simply" generate the necessary XML (either Word 2003
format, or 2007 format) for the entire document, but in my experience these
XML formats are sufficiently complex that there is quite a lot of work
involved in working out the correct XML to generate for each record.

However, just out of interest, are you using MS SQL Server (i.e. not some
other "SQL server") and if so, have you looked at and rejected SQL Server
Reporting Services as a mechanism for providing reports to the user? I have
never used that approach but unless you need to end up with a Word document,
it has (I have to assume) all the necessary stuff for generating and
providing reports and is designed to work with .NET and SQL Server.

Peter Jamieson


"Paul" wrote in message
...
Hi there.
I have a .NET 2.0 website with a SQL server backend. I want to allow the
user to select a report that will be generated & downloaded to the user on
the fly. The report will be based on a stored Word template/document. The
template/document will include either content controls or mail merge tags
to
be replaced by data from the SQL database.

I can use Word 2003 or 2007.

I have looked at 2007 content controls but these do not seem to allow
repeated content controls for table data. i.e. order lines from an order.
The
reports will have a mixture of single fields and some repeated fields in
tables.

Does anyone know of a suitable solution to this problem and any links to
sample code than may be of use?

Thank you for any help offered.



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
paul paul is offline
external usenet poster
 
Posts: 249
Default Merged Word 2003/2007 document from .NET website & SQL data

Peter

Thank you for your reply.

I'm afraid that it is as I suspected and I am going to have to write some
custom code somewhere to do what I want. Thank you for the suggestion of the
SQL reporting. I had thought of that already but the customer wants to end up
with Word documents that they can then modify before passing on to their own
customers.

If anyone else can suggest any solution in the meantime, please let me know.

Regards
Paul

"Peter Jamieson" wrote:

Word does not really do the parent/child reporting thing - for possible ways
to do it, see e.g.

http://homepage.swissonline.ch/cindy...r/mergfaq1.htm

http://support.microsoft.com/default...b;en-us;211303

Or you can "roll your own" merge, generating the Word document dynamically
using macro code (or possibly, using Word's MailMerge Events, although I
suspect that's a bad idea here). Content controls might help in Word 2007 if
you were able to dynamically alter the XML data that the Content control
references (I haven't worked with these things much so cannot tell you
whether or not that is feasible and how to do it if it is). Your server
could in theory "simply" generate the necessary XML (either Word 2003
format, or 2007 format) for the entire document, but in my experience these
XML formats are sufficiently complex that there is quite a lot of work
involved in working out the correct XML to generate for each record.

However, just out of interest, are you using MS SQL Server (i.e. not some
other "SQL server") and if so, have you looked at and rejected SQL Server
Reporting Services as a mechanism for providing reports to the user? I have
never used that approach but unless you need to end up with a Word document,
it has (I have to assume) all the necessary stuff for generating and
providing reports and is designed to work with .NET and SQL Server.

Peter Jamieson


"Paul" wrote in message
...
Hi there.
I have a .NET 2.0 website with a SQL server backend. I want to allow the
user to select a report that will be generated & downloaded to the user on
the fly. The report will be based on a stored Word template/document. The
template/document will include either content controls or mail merge tags
to
be replaced by data from the SQL database.

I can use Word 2003 or 2007.

I have looked at 2007 content controls but these do not seem to allow
repeated content controls for table data. i.e. order lines from an order.
The
reports will have a mixture of single fields and some repeated fields in
tables.

Does anyone know of a suitable solution to this problem and any links to
sample code than may be of use?

Thank you for any help offered.




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Word 03/07 doc from .NET website with SQL data Paul Microsoft Word Help 1 April 1st 07 12:19 PM
Can data entered into a form be merged into another document? katispil Microsoft Word Help 1 January 5th 07 10:50 AM
Totaling merged data in new document Roy Carlson Mailmerge 13 June 30th 06 08:18 PM
how do i include data source into merged document? Jason Mailmerge 2 January 27th 06 08:02 AM
Macro to add data to merged document FJB Mailmerge 1 August 9th 05 06:22 AM


All times are GMT +1. The time now is 10:49 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"