• elham_azizi_62 (1/26/2013)


    Dear Tavis.

    We need to have one dataset with more than 1 datatable in word mail merge .is it possible this?

    You could start by creating a mock-up (example) Word document with all the elements you need: title, heading, paragraph of text, all the tables each with a row of column headings and two rows from the dataset.

    Then you can save this document as XML: Save As > Other Formats > Word XML document.

    This will give you the target document to aim for, although it will be complex and have more structure and content than you actually need to generate from your query. You can then think about the best way to create this document, directly (as in the code above), through a simpler format like HTML that Word can open and convert, or through an intermediary format that can be converted into Word by other means, or using some other existing tool or process.

    I am assuming that you have looked at other options like Reporting Services export to Word or whatever, and these are not suitable for you.

    If you attach a sample Word document showing your tables (column headings and two rows of dummy data each would be fine), we can take a look at it and give more suggestions.