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

Free Support Forum - aspose.com

Value was either too large or too small for an Int32

We are using Aspose.Words version 13.3.0.0

I have found an issue where I have a data element in my merge data set with a value of "R20140507009".

If I use that merge field in an IF statement on my document, such as:

{ IF { MERGEFIELD "Cs_LegacyFileNumber" } <> ""....

the document.MergeWithRegions throws this error:

Message:
Value was either too large or too small for an Int32.

Stack Trace:

at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at x2a6f63b6650e76c4.xe02d79c539b6382d.x1f490eac106aee12(Table x1ec770899c98a268, String xc15bd84e01929885, Int32 x2238fe9b8f06bd9d)
at x2a6f63b6650e76c4.x393ce53fde4b6f6e.x1f490eac106aee12(Table x1ec770899c98a268, String x2998bc0b2545c5b6, String xd58ddfc523d7f291)
at x2a6f63b6650e76c4.x393ce53fde4b6f6e.x19890931227f0f56(x12e7545fad3ccc9b x0f7b23d1c393aed9, String xc15bd84e01929885, Boolean x87e8133a83e97e91, x209f3e4a2f735d1e& x9b10ace6509508c0)
at x2a6f63b6650e76c4.xd8780e89a96f3f1a.x9f7dc7131ed07aa4(String x137ffa3012d6a67d)
at x2a6f63b6650e76c4.xd8780e89a96f3f1a.x1f490eac106aee12()
at x2a6f63b6650e76c4.x6d929209cd800011.x308cb2f3483de2a6(x12e7545fad3ccc9b x0f7b23d1c393aed9)
at x2a6f63b6650e76c4.xa4690fb61715fc9b.x335c6a74b612cfe6(Field xe01ae93d9fe5a880, x6f82c326b827643c xbf5efe8743edba7b)
at xfbd1009a0cbb9842.xedefa1db6f5ff538.xfcc1c57a5276ff93()
at Aspose.Words.Fields.Field.x0b575d343c8e4df3()
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.xbf9ddf72e1283af9.x18dfca7c5fd2402f()
at xfbd1009a0cbb9842.xfedf115fd9c03862.xdd6cf0348a23f220(xcf417e2db4fe9ed3 xe00c282e1a49fcfb)
at xfbd1009a0cbb9842.xfedf115fd9c03862.xdf269951086089ce(x864e471e9e1ff2b4 xa942970cc8a85fd4)
at xe86f37adaccef1c3.xc5c3f438428cb03b.xdeeb682062ef79a5()
at xe86f37adaccef1c3.xc5c3f438428cb03b.xd5da23b762ce52a2(xa11a4c48b53f49a6 xef1769c4fe6ae4ca, Boolean xc9c7b90943167aed)
at Aspose.Words.Reporting.MailMerge.xde367ad9e467ebf9(xe0a98df97f5fe1f3 xa62cbc5ccf369616)
at KCMS.DAL.MailMerge.MakeASingleFile(Object FileNumberOrReferralId, DataSet& dsMerge, String rootUncKey, FileInfo templateFileInfo, String dateTimeSuffix, String separateDocID, String documentCategory, String includeInCourtTransfer, String eventCode, Int64 EventIndex) in c:\inetpub\wwwroot\PBKCAAmador\App_Code\DAL\MailMerge.cs:line 2461


Hi Joe,

Thanks for your inquiry. I would suggest you please upgrade to the latest version (v14.4.0) from here and let us know how it goes on your side. If the problem still remains, please attach your input Word document here for testing. I will investigate the issue on my side and provide you more information.