the lv_CommentLine.Attachment is my BLOB field but whenever it reaches the EXPORT method
i receive the error that i cannot export an empty blob file?
lv_CommentLine.RESET;
lv_CommentLine.SETRANGE("Table Name",lv_CommentLine."Table Name"::Item);
lv_CommentLine.SETRANGE("No.",lv_PackingLine."No.");
lv_CommentLine.SETRANGE(Type,lv_CommentLine.Type::MSDS);
lv_CommentLine.SETFILTER("Document Name",'<>%1','');
IF lv_CommentLine.FINDSET THEN BEGIN
lv_TremRoute.SETCURRENTKEY("Customer No.",Language);
REPEAT
IF lv_TremRoute.GET(lv_PackingHeader."Sell-to Customer No.",lv_CommentLine.Language) THEN BEGIN
lv_FileName := lv_CommentLine.Attachment.EXPORT;
PrintFile(lv_FileName);
END;
UNTIL lv_CommentLine.NEXT = 0;
END;
You have to first do a CALCFIELDS on the BLOB field to see if it has value:
............
IF lv_TremRoute.GET(lv_PackingHeader."Sell-to Customer No.",lv_CommentLine.Language) THEN BEGIN
lv_CommentLine.CALCFIELDS(Attachment);
IF lv_CommentLine.Attachment.HASVALUE THEN
lv_FileName := lv_CommentLine.Attachment.EXPORT;
PrintFile(lv_FileName);
END;
............
Answers
From Toolbox use Picture box
In Picture box properties--> Source expression--> enter:Picture
Example: Item.Picture
the lv_CommentLine.Attachment is my BLOB field but whenever it reaches the EXPORT method
i receive the error that i cannot export an empty blob file?
lv_CommentLine.RESET;
lv_CommentLine.SETRANGE("Table Name",lv_CommentLine."Table Name"::Item);
lv_CommentLine.SETRANGE("No.",lv_PackingLine."No.");
lv_CommentLine.SETRANGE(Type,lv_CommentLine.Type::MSDS);
lv_CommentLine.SETFILTER("Document Name",'<>%1','');
IF lv_CommentLine.FINDSET THEN BEGIN
lv_TremRoute.SETCURRENTKEY("Customer No.",Language);
REPEAT
IF lv_TremRoute.GET(lv_PackingHeader."Sell-to Customer No.",lv_CommentLine.Language) THEN BEGIN
lv_FileName := lv_CommentLine.Attachment.EXPORT;
PrintFile(lv_FileName);
END;
UNTIL lv_CommentLine.NEXT = 0;
END;
Regards