Hi.
I've tried, but can't find documentation to explain this simply (well, simple enough for me) or an example.
All I want to do is write the contents of a BLOB (a picture) to a file - without the "Save As" dialog (I have a filename/path already.)
This is as far as I get:
// PicFile - File
// OStream - Outstream
// Filename - text(30)
FileName := 'C:\SOMEFILENAME.BMP';
IF EXISTS(FileName) THEN
ERASE(FileName);
PicFile.CREATE(FileName);
PicFile.TEXTMODE(FALSE);
PicFile.CREATEOUTSTREAM(OStream);
OStream.WRITE(Rec.Blob);
PicFile.CLOSE;
And this is the error:
You are using an invalid datatype for this function
Can someone show me where I'm missing something?
Thanks!!!
(PS - This is NAV 4.0 SP3.)
Answers
Thanks.
Is there a way to export the content of a blob (xml in my case) to a file from the RTC?
Regards,
Jes
Have a look at them.. :thumbsup:
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
This is my code in Import :
FileExists := Rec.Attachment.HASVALUE;
IF Rec.Attachment.IMPORT('*.*',TRUE) = '' THEN
EXIT
ELSE
IF STRPOS(Rec.Attachment.IMPORT('*.*',TRUE),'.') = 0 THEN
ExtensionFile := COPYSTR(Rec.Attachment.IMPORT('*.*',TRUE),1);
MODIFY;
IF FileExists THEN
IF NOT CONFIRM(Text004,FALSE) THEN
EXIT;
CurrForm.SAVERECORD;