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.
0
Answers
As for why it works on the server, my best guess would be that different versions of some system DLLs are the culprit
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.
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.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!