Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Wed Mar 27, 2013 12:01 am

During testing Spire.Office v2.5.3, I've noticed problem with savetopdf for mergfield that contains text as space+percentage (" %"). Removing the space before % sign solves the problem. Illustrated on attached image.

FYI, we have now applied v2.5.3 in production. Previous issue with margin problems for tables is solved.

Problems in v2.5.3 related to actual text in mergefields seems to be:
- single LF needs to be changed to CR in mergfields (multiline textfields)
- " %" replaced by "%" (issue shown on picture)

In addition to problems above, this version always throws system.exception from line:
document.MailMerge.ExecuteWidthNestedRegion(ds, listRelations)
Stacktrace below:
ved Spire.Doc.Reporting.MailMerge.ᜁ.ᜀ(BodyRegionCollection A_0)
ved Spire.Doc.Reporting.MailMerge.ᜁ.ᜀ(Body A_0, IRowsEnumerator A_1)
ved Spire.Doc.Reporting.MailMerge.ᜀ(Section A_0, IRowsEnumerator A_1)
ved Spire.Doc.Reporting.MailMerge.ᜇ(String A_0)
ved Spire.Doc.Reporting.MailMerge.ExecuteWidthNestedRegion(DataSet dataSet, List`1 commands)
ved ToPDF.Form1.button1_Click(Object sender, EventArgs e) i C:\Program Files (x86)\e-iceblue\Spire.Office\Demos\DocDemos\VB\WinForms\05_Convertors\ToPDF\Form1.vb:linje 129

Code: Select all
Dim ds As New DataSet
Dim xmlFilename As String = cDir + "DataSet2.xsd"
ds.ReadXmlSchema(xmlFilename)
xmlFilename = xmlFilename.Replace(".xsd", ".xml")
ds.ReadXml(xmlFilename)

Try
    document.MailMerge.ExecuteWidthNestedRegion(ds, listRelations)
Catch ex As Exception

End Try

                Dim outFilename As String = cDir + "Output2"
                document.SaveToFile(outFilename.TrimEnd + ".doc", FileFormat.Doc)
                'document.SaveToFile(outFilename.TrimEnd + ".html", FileFormat.Html)
                document.SaveToFile(outFilename.TrimEnd + ".docx", FileFormat.Docx)
                document.SaveToFile(outFilename.TrimEnd + ".pdf", FileFormat.PDF)
                'document.SaveToFile(outFilename.TrimEnd + ".rtf", FileFormat.Rtf)


Did start today to create a test case for you could not finish it. Seems also to be difference in production for Winforms program versus Web program. Not sure whether it's mostly ENCODING issues or difference in libraries. And finally the time where flew away on finding the percentage issue described here.

krhyll
 
Posts: 23
Joined: Fri Nov 11, 2011 12:27 pm

Wed Mar 27, 2013 2:39 am

Dear Kristian,

Thanks for your inquiry.
For the error you met when ran the code document.MailMerge.ExecuteWidthNestedRegion(ds, listRelations),
we are so sorry for the inconvenience. Could you please provide us the template file, DataSet2.xsd file, DataSet2.xml file and the code about listRelations? So that we can do the test to reproduce this issue and find the cause which caused this issue. Thank you!

Thanks &Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Tue Apr 16, 2013 8:09 am

Dear Kristian,

Thanks for your waiting.
The new hotfix of Spire.Office which fixed all your issues has been released. Please download and test Spire.Office Platinum (Hot Fix) Version:2.5.7(http://www.e-iceblue.com/Download/download-office-for-net-now.html).
Have any issues, please feel free to contact us.

Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.Doc