Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all articles
Browse latest Browse all 10032

Importing/Exporting Word document from NAV Blob sometimes results in corrupted file

$
0
0
NAV2015 - Build 40459

We have a functionality where users can create word documents for a record. This is stored in a Blob field; nothing special so far.

Here's where it gets interesting:

If I save my document (before importing it) via NAVWordHelper.CallSaveAs:
  • If my Word application default language is Dutch (even with English also present) it will work fine;
  • If my Word application default language is English (with or without Dutch present), it produces a "Document appears to be corrupted" error

However:
If I save my document (before importing it) via NAVWordHelper.CallSaveAsFormat with wdFormatStrictOpenXMLDocument format:
  • If my Word application default language is English (with or without Dutch present) it will work fine;
  • If my Word application default language is Dutch (even with English also present), it produces a "Document appears to be corrupted" error

Windows regional settings have no impact on either set of results.

Other information:
  • I have not yet tested with other languages, but I would have thought that OpenXmlFormat would be language independent.
  • It seems that only Dutch (Netherlands) is causing an issue with the wdFormatStrictOpenXMLDocument - I have tested Arabic (Iraq), Chinese (PRC), Dutch (Belgium) and German and they all seem to work well
  • Blob compression settings have no impact.
  • The corruption seems to be present in the Styles.xml at least
  • The corruption might be linked to collation, since in the corrupted file (Styles.xml) "Colorful" is consistently represented as Col5rful (as in w:name="Col5rful List Accent 4")
  • Using TextEncoding other than Windows while importing/exporting the blobs produces I/O errors - most likely because TextMode = FALSE.
  • Using TextEncoding in the CreateOutStream/CreateInStream functions likewise has no effect
  • Environment is NAV2015 - Build 40459
  • I have tried several other methods of storage, but none have proved multilingually sound, so far

Edit: updated for testing of additional languages

Viewing all articles
Browse latest Browse all 10032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>