Show documents in VL Web

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
René Houba
Posts: 220
Joined: Thu Nov 26, 2015 7:03 am

Show documents in VL Web

Post by René Houba »

Hi,

I'm rebuilding for a customer a VLF Windows system into VL Web.

In the existing VLF Windows system they have BLOB fields to show all kind of documents (for example PDF's using the AcrobatReader).

***********************************************
Mthroutine Name(umShowDoc)
If (#DocumentBLOB.FileName = '')
Use Builtin(MESSAGE_BOX_CLEAR)
Use Builtin(MESSAGE_BOX_ADD) With_Args('File failed to download from the document store')
Use Builtin(MESSAGE_BOX_SHOW) With_Args(OK OK ERROR)
Return
Endif
#PANL_Right.Style <= *NULL
Case Of_Field(#ufDocumentFormat.UpperCase)
When Value_Is(= 'PDF')

#ruAcrobatReaderWebEmbedded.umShowPDF Uvifilename(#DocumentBLOB.FileName) Uvishowscrollbar(True) Uvishowtoolbar(True)
#ruAcrobatReaderWebEmbedded.Visible := True

When Value_Is('= JPG' '= GIF' '= BMP' '= PNG')
* #axAdobeReader.Visible := False
#ruAcrobatReaderWebEmbedded.Visible := False
#uoImage <= #SYS_APPLN.CreateBitmap
#uoImage.FileName := #DocumentBLOB.FileName
#PANL_Right.Style <= #usImageStyle
#usBrush.Image <= #uoImage


Otherwise
* #axAdobeReader.Visible := False
#ruAcrobatReaderWebEmbedded.Visible := False
Define Field(#ufRetValue) Type(*dec) Length(7) Decimals(0)

Use Builtin(SYSTEM_COMMAND) With_Args(H #DocumentBLOB.Filename) To_Get(#ufRetValue)
Endcase
Endroutine

***********************************************


Can I do the same when I build this in VL Web????


Kind regards,
René
User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: Show documents in VL Web

Post by Stewart Marshall »

Hi Rene

Browsers are not allowed access to execute a file that has been downloaded.

The best you can do is to download the blob as a file and leave it to the user to execute

Have a look at xDemoWebImageDownload

Regards
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au
René Houba
Posts: 220
Joined: Thu Nov 26, 2015 7:03 am

Re: Show documents in VL Web

Post by René Houba »

Hi Stewart,

They ONLY want to show the document. Will I have the same problem then??

Kind regards,
René
MarkDale
Posts: 116
Joined: Wed Dec 02, 2015 10:06 am

Re: Show documents in VL Web

Post by MarkDale »

There are some shipped VLF-ONE examples that might help show options you can use.

In the VLF-ONE demo, they are under Example Applications --> Use Case --> Upload Download --> Examples 2 and 3 (DF_T68H2O DF_T68H3O)

But you would need to test your solution on a variety of browsers and PCs, because the behaviour seems to vary.
User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: Show documents in VL Web

Post by Stewart Marshall »

Hi Rene

unless the browser has a feature that specifically supports showing a given file type, there is nothing you can do.

Regards
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au
trossiter
Posts: 34
Joined: Wed Feb 22, 2017 3:19 am

Re: Show documents in VL Web

Post by trossiter »

I may have found a way to do this by accident, but I'm not sure.

The reusable part I was writing used a modified copy of the LANSA supplied reusable part UF_VATT - Attached Documents. I forgot to call the uLoadTray method in my reusable part. When I viewed an item that had an attached document, instead of showing the attachment in a file explorer, it was showing me the contents of the document (a PDF in this case), and I was able to scroll through it and view it. It did the same thing when I tried dragging and dropping a file onto the attachment handler; it "opened" the document so I could view it and still saved it to my attachments file.

If this is what you're looking for, I wonder if you'll be able to do something similar for VL Web. I haven't worked with VL Web, so I'm not too sure. If you can, though, you'll just have to make sure the size of the attachment handler is large enough that the document being viewed is readable.
Theron Rossiter
Kawasaki Motors Manufacturing Corp., USA
Post Reply