Print a doc which was inserted in BLOB field

tompynationtompynation Member Posts: 398
How can we print the *.doc files which are imported into BLOB fields?

Answers

  • MBergerMBerger Member Posts: 413
    If it's only word documents, then i'd save the BLOB to a temporary file, and use automation to open and print it.
  • suvidhasuvidha Member Posts: 117
    Hi,
    From Toolbox use Picture box
    In Picture box properties--> Source expression--> enter:Picture
    Example: Item.Picture
  • MBergerMBerger Member Posts: 413
    suvidha wrote:
    Hi,
    From Toolbox use Picture box
    In Picture box properties--> Source expression--> enter:Picture
    Example: Item.Picture
    ..which won't work with the .doc files he has stored as BLOB's
  • tompynationtompynation Member Posts: 398
    i cant get it to work...

    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;
  • BBlueBBlue Member Posts: 90
    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;
    ............
    

    Regards
    //Bogdan
  • tompynationtompynation Member Posts: 398
    ok thanks working fine now
Sign In or Register to comment.