Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Create Word 03/07 doc from .NET website with SQL data | Microsoft Word Help | |||
Can data entered into a form be merged into another document? | Microsoft Word Help | |||
Totaling merged data in new document | Mailmerge | |||
how do i include data source into merged document? | Mailmerge | |||
Macro to add data to merged document | Mailmerge |