Complex Mailmerge does not work

Hi,

we want to execute server side word mail merge. Currently we use word automation (via c# interop) for that and aspose .NET is subject to be a drop in replacement. The Mail Merge Template is attached (as Image, in real its a XML word template and we can send to you by mail but we can not made it public). The data is simple CSV, the code we use for the merge Looks like:

   	   DataTable dsResult = null;
        <span style="color: blue;">using</span> (<span style="color: darkblue;">GenericParserAdapter</span> parser = <span style="color: blue;">new</span> <span style="color: darkblue;">GenericParserAdapter</span>(<span style="color: darkblue;">Directory</span>.<span style="color: darkcyan;">GetCurrentDirectory</span>() + <span style="color: rgb(163, 21, 21);">"\\ds.txt"</span>))
        {
            parser.<span style="color: purple;">ColumnDelimiter</span> = <span style="color: rgb(163, 21, 21);">','</span>;
            parser.<span style="color: purple;">FirstRowHasHeader</span> = <span style="color: blue;">false</span>;
            parser.<span style="color: purple;">TextQualifier</span> = <span style="color: rgb(163, 21, 21);">'\"'</span>;
            dsResult = parser.<span style="color: darkcyan;">GetDataTable</span>();
             
        <span style="color: darkblue;">Document</span> doc = <span style="color: blue;">new</span> <span style="color: darkblue;">Document</span>(<span style="color: darkblue;">Directory</span>.<span style="color: darkcyan;">GetCurrentDirectory</span>() + <span style="color: rgb(163, 21, 21);">"\\wtemplate.xml"</span>);

        <span style="color: darkblue;">Console</span>.<span style="color: darkcyan;">WriteLine</span>(<span style="color: rgb(163, 21, 21);">"template loaded"</span>);

           doc.<span style="color: purple;">MailMerge</span>.<span style="color: darkcyan;">Execute</span>(dsResult);

        <span style="color: darkblue;">Console</span>.<span style="color: darkcyan;">WriteLine</span>(<span style="color: rgb(163, 21, 21);">"merge done"</span>);

        <span style="color: green;">// Saves the document to disk.</span>
        doc.<span style="color: darkcyan;">Save</span>(<span style="color: darkblue;">Directory</span>.<span style="color: darkcyan;">GetCurrentDirectory</span>() + <span style="color: rgb(163, 21, 21);"><a href="file://\\MailMerge aspose Result Out.docx">\\MailMerge aspose Result Out.docx</a></span>);</pre><pre style="background: white; color: black; font-family: Consolas; font-size: 13px;"><pre style="background: white; color: black; font-family: Consolas; font-size: 13px;">   	}

Sample data is attached too.
The resulting Word-Document does not look like the document which is generated by word interop.
So my question is: Is such a template (see attachment) supported by aspose and what can i do to make it work?
 
Thanks in advance
 
 
Hi Hendrik,

Thanks for your inquiry.

Unfortunately, it is difficult to say what the problem is without the document. We need your template Word document to reproduce the same problem on our end. Please note that it is safe to attach files in the forum. If you attach your document here, only you and Aspose staff members can download it. Also, you can send the file to my e-mail as described here:
http://www.aspose.com/corporate/purchase/faqs/send-license-to-aspose-staff.aspx

You can also remove any sensitive information from your document by replacing it with dummy data instead.
Best regards,

Thanks for your quick reply, pls find the template, desired result and datasource attached

Hi Hendrik,


Thanks for your inquiry. Unfortunately, at the moment, we’re not able to reproduce this issue on our end because some bits of code are missing from your shared code (GenericParserAdapter class definition is missing). Please create a standalone (runnable) simple console application that helps us reproduce the same problem on our end and attach it here for testing. As soon as you get this application ready, we’ll investigate the issue further and log an issue. Thanks for your cooperation.

Best regards,