Send to Excel - Error

Jedrox
Member Posts: 2
Hello, greetings, my name is Jhonny.
If I press send to excel button in my client version of nav 2015, my session is closed.
I've been checking the event viewer and found this:
Message: '', hexadecimal value 0x02, is an invalid character
StackTrace:
en System.Xml.XmlUtf8RawTextWriter.InvalidXmlChar(Int32 ch, Byte* pDst, Boolean entitize)
en System.Xml.XmlUtf8RawTextWriter.WriteElementTextBlock(Char* pSrc, Char* pSrcEnd)
en System.Xml.XmlUtf8RawTextWriter.WriteString(String text)
en System.Xml.XmlWellFormedWriter.WriteString(String text)
en DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)
en DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w)
en DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)
en DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w)
en DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)
en DocumentFormat.OpenXml.OpenXmlPartWriter.WriteElement(OpenXmlElement elementObject)
en Microsoft.Dynamics.Nav.Runtime.Office.OfficeExcelListRender.ReplaceDataSheet(Stream dataStream, WorksheetWriter worksheetWriter, Func`1 valueLists)
en Microsoft.Dynamics.Nav.Runtime.Office.OfficeExcelListRender.WriteDataStream(Stream dataStream)
en Microsoft.Dynamics.Nav.Runtime.Office.OfficeExcelListRender.GenerateExcelDocument(String filename)
en Microsoft.Dynamics.Nav.Runtime.NavForm.SaveAsExcel(DataError errorLevel, Int32 languageId, String fileName)
en Microsoft.Dynamics.Nav.Service.NSService.SendDataToDocument(NavRecordState recordState, OfficeDocumentType documentType)
en SyncInvokeSendDataToDocument(Object , Object[] , Object[] )
en System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
en Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.ErrorMappingCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs)
Source: System.Xml
The weird thing is that if I do this inside the server, this error doesn't occur.
Please help.
If I press send to excel button in my client version of nav 2015, my session is closed.
I've been checking the event viewer and found this:
Message: '', hexadecimal value 0x02, is an invalid character
StackTrace:
en System.Xml.XmlUtf8RawTextWriter.InvalidXmlChar(Int32 ch, Byte* pDst, Boolean entitize)
en System.Xml.XmlUtf8RawTextWriter.WriteElementTextBlock(Char* pSrc, Char* pSrcEnd)
en System.Xml.XmlUtf8RawTextWriter.WriteString(String text)
en System.Xml.XmlWellFormedWriter.WriteString(String text)
en DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)
en DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w)
en DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)
en DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w)
en DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)
en DocumentFormat.OpenXml.OpenXmlPartWriter.WriteElement(OpenXmlElement elementObject)
en Microsoft.Dynamics.Nav.Runtime.Office.OfficeExcelListRender.ReplaceDataSheet(Stream dataStream, WorksheetWriter worksheetWriter, Func`1 valueLists)
en Microsoft.Dynamics.Nav.Runtime.Office.OfficeExcelListRender.WriteDataStream(Stream dataStream)
en Microsoft.Dynamics.Nav.Runtime.Office.OfficeExcelListRender.GenerateExcelDocument(String filename)
en Microsoft.Dynamics.Nav.Runtime.NavForm.SaveAsExcel(DataError errorLevel, Int32 languageId, String fileName)
en Microsoft.Dynamics.Nav.Service.NSService.SendDataToDocument(NavRecordState recordState, OfficeDocumentType documentType)
en SyncInvokeSendDataToDocument(Object , Object[] , Object[] )
en System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
en Microsoft.Dynamics.Nav.Service.ServiceOperationInvoker.ErrorMappingCombinator(ServiceOperation innerOperation, NSServiceBase serviceInstance, Object[] inputs, Object[]& outputs)
Source: System.Xml
The weird thing is that if I do this inside the server, this error doesn't occur.
Please help.
0
Best Answer
-
One possibility is that the data you're trying to export has some invalid characters, such as newlines and similar. It happens quite often when, for example, users copy Customer/Vendor address from their website, or Excel and accidentally copy in an invisible newline character. NAV client doesn't show them, but they are in the actual data. So you'd need to investigate the data that causes this error for any invalid characters.
As for why it works on the server, my best guess would be that different versions of some system DLLs are the culprit1
Answers
-
One possibility is that the data you're trying to export has some invalid characters, such as newlines and similar. It happens quite often when, for example, users copy Customer/Vendor address from their website, or Excel and accidentally copy in an invisible newline character. NAV client doesn't show them, but they are in the actual data. So you'd need to investigate the data that causes this error for any invalid characters.
As for why it works on the server, my best guess would be that different versions of some system DLLs are the culprit1 -
Thanks for your reply, that seems to be the reason.
So far I have found a couple of these in the database.
Do you know of any way to remove these characters from the database?
My idea is to use "DELCHR" 2 times in nav, the first to save the special characters and the second to delete these same characters.
0 -
As long as you know the illegal characters (or their ASCII code), you shouldn't need to do it twice. Once should be enough, f.x.:
Customer.GET(CustomerCode); //Or filter and loop through Customer.Address := DELCHR(IllegalCharVar, '=', Customer.Address); Customer.Modify(false);
If you don't know exactly in which field the characters are, you should look doing this in SQL, as it would probably be significantly faster than for C/AL code to loop through each record's each text/code field looking for the characters.1 -
[Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Three Tier' forum]
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions