We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose Crash during Mail Merge

I have just built a little bit of test code to try and run a mail merge on an example document that has been provided to me by my customer and am getting an exception thrown in the Aspose library (“Object reference not set to an instance of an object”, stack trace below). When I ran this test before having a license it “worked” in that it didn’t throw any exception, but after adding these lines:

License l = new License();

it now has a problem. I suspect why it worked without specifying the license before-hand was because it was only processing the first page and didn’t get as far as whatever the bug is that causes the problem.

The merge I’m attempting is fairly complex - the word document has quite a few rules and uses IF, SET, COMPARE etc. Just to be thorough I tested the license with a simple merge document I created in Word and it worked perfectly, so it must be that the Aspose library is crashing during the merge due to the complexity.

Can you please let me know if there is anything I can do to work around the problem below. I really like the look of your product and would be disappointed if it can’t handle the documents we need for this project.

Here is the Stack Trace:

at x28925c9b27b37a46.x98739d759efb5fe7.get_x1be93eed8950d961()
at x28925c9b27b37a46.x98739d759efb5fe7.x8a92b04b9d325900()
at x28925c9b27b37a46.x98739d759efb5fe7.xeea9b43f0c912fdb(Node xda5bf54deb817e37)
at Aspose.Words.Node.x94cfa410ea3bb516()
at xfbd1009a0cbb9842.xe11422ab90fb5f3b.x80766db8f9759629()
at xfbd1009a0cbb9842.xdbc94e34c2e61de1.x1f96778a29980753(x5c928e5f0a98a22c x9af1c2b12bb7a91a)
at xfbd1009a0cbb9842.x2d380f6141585930.x1f96778a29980753()
at xfbd1009a0cbb9842.x2d380f6141585930.x42be32a552bb83b8()
at xfbd1009a0cbb9842.x2d380f6141585930.x2408a6db33935c93()
at xfbd1009a0cbb9842.x985dd08fd338eeea.x1f490eac106aee12(x2d380f6141585930 xbce90b56ab411c23)
at xfbd1009a0cbb9842.x985dd08fd338eeea... ctor(Field field, x5e36356bc92c609b updateContext, x6ed66b5cf8da2955 switchResolver)
at xfbd1009a0cbb9842.x985dd08fd338eeea... ctor(x5e36356bc92c609b updateContext)
at xfbd1009a0cbb9842.x5e36356bc92c609b.x496cb6c60c307cd1()
at Aspose.Words.Fields.Field.x42a25ae95099edb8(x5e36356bc92c609b x0f7b23d1c393aed9)
at Aspose.Words.Fields.Field.x295cb4a1df7a5add(x5e36356bc92c609b x0f7b23d1c393aed9)
at xfbd1009a0cbb9842.xfedf115fd9c03862.x4e3cfc222c92cda7(Field xe01ae93d9fe5a880, x5e36356bc92c609b x0f7b23d1c393aed9)
at xfbd1009a0cbb9842.xfedf115fd9c03862.x4e3cfc222c92cda7(Field xe01ae93d9fe5a880)
at xfbd1009a0cbb9842.xbf9ddf72e1283af9.x18dfca7c5fd2402f()
at xfbd1009a0cbb9842.xfedf115fd9c03862.xdd6cf0348a23f220(xcf417e2db4fe9ed3 xe00c282e1a49fcfb)
at xfbd1009a0cbb9842.xfedf115fd9c03862.xdf269951086089ce(x6435b7bbb0879a04 xa942970cc8a85fd4)
at xe86f37adaccef1c3.xc5c3f438428cb03b.xd01ea9131ba53b87(ArrayList x292b5f49fee42032, xfedf115fd9c03862 xcc5022025f73a533)
at xe86f37adaccef1c3.xc5c3f438428cb03b.xdeeb682062ef79a5()
at xe86f37adaccef1c3.xc5c3f438428cb03b.xd5da23b762ce52a2(MailMerge x2a99de81295e7f29, IMailMergeDataSource xef1769c4fe6ae4ca, Boolean xc9c7b90943167aed)
at Aspose.Words.Reporting.MailMerge.Execute(IMailMergeDataSource dataSource)
at Aspose.Words.Reporting.MailMerge.Execute(String[] fieldNames, Object[] values)
at Aspose.Words.Demos.WebForms._Default.OnLoad(EventArgs e) in C:\Program Files\Aspose\Aspose.Words for .NET\Demos\CSharp\WebForms\Default.aspx.cs:line 94
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

The code I’m using is:

License l = new License();
Document doc = new Document("c:\Merge.docx");
String[] names = null;
String[] vals = null;
using(Microsoft.VisualBasic.FileIO.TextFieldParser p = new Microsoft.VisualBasic.FileIO.TextFieldParser("c:\Data.csv"))
    p.TextFieldType = Microsoft.VisualBasic.FileIO.FieldType.Delimited;
    p.HasFieldsEnclosedInQuotes = true;
    names = p.ReadFields();
    vals = p.ReadFields();
doc.MailMerge.Execute(names, vals);

The input Data.csv file contains 309 name/values for this particular file but for other documents could contain up to about 500.

Thanks for your request. Could you please attach your template and data source here for testing? We will check the issue and provide you more information.
Best regards,

Unfortunately I cannot as the resulting document and input data is confidential and I will not be able to get authorisation to distribute it. Is there any other way you can investigate this problem?

Thanks for your request. Actually we do not need your output document and real data. We need only your template and sample data that will allow us to reproduce the problem.
Best regards,

Hi, I have cut away at the document until I’ve got down to a few bits of text left that are causing the problem. It didn’t matter what I had for the csv data either, so I’ve included just a single field csv file here. What I need to understand is firstly if you are going to fix the problem, and if so how soon could that be done? I need to submit my proposal tomorrow and want to have some confidence that your product will actually work for the intended purposes. Please see attachment.

Thank you for additional information. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.
Unfortunately, currently I cannot provide a reliable estimate. The responsible developer will analyze the issue and then we will provide you more information.
Best regards,

The issues you have found earlier (filed as WORDSNET-5359) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.