03-12-2018 11:04 AM
I have one vi where I save a .rtf file to a database like so:
Upload From Computer
Later, I get the file from the database and save it as an .rtf before I open it with another vi (*rtf viewer.vi*):
Download from DB
However, Although *rtf viewer.vi* will work with files that are not uploaded to the database, it cannot read these files. Opening a file in Notepad++ gets me the following:
Ā萀ĀĀ ᄠĀ
�{\rtf1\ansi\ansicpg1252\deff0\deflang1033\deflangfe1033{\fonttbl{\f0\fswiss\fprq2\fcharset0
Calibri;}{\f1\froman\fprq2\fcharset2 Symbol;}}
\viewkind4\uc1\pard\sa160\sl252\slmult1\b\f0\fs22 Known Issues:\par
\pard\fi-360\li720\sa160\sl252\slmult1\b0\f1\'b7\tab\f0 VI Displays no
error when "Print." is Selected with no printer attached\par
\f1\'b7\tab\f0 Arduino driver does not currently initialize with
startup\par \pard\sa160\sl252\slmult1\b Improvement Points:\par
\pard\fi-360\li720\sa160\sl252\slmult1\b0\f1\'b7\tab\f0 Time numeric
constants are listed in numeric format time format\par \f1\'b7\tab\f0
Does not support test steps longer than 50 days\b\par
\pard\sa160\sl252\slmult1 Change Log:\par
\pard\fi-360\li720\sa160\sl252\slmult1\b0\f1\'b7\tab\f0 [Date] Fixed
Issue with Results Display - JLS\par \f1\'b7\tab\f0 [Date] Added
Arduino Control -JLS\par }
The file does save, however, it's not able to be read by my viewer vi.
What do I need to do to get my .rtf viewer to understand the file like it was able to before?
Solved! Go to Solution.
03-19-2018 10:38 AM
I more or less tried to replicate the issue by converting to Variant and saving the data directly to file and got something similar to what you're seeing. The variant has a bunch of extra bytes, probably to describe data types and sizes.
If I convert the variant to string and then make sure I set the Prepend Array or string size? boolean to False, it saves the RTF file correctly: