LabVIEW Web UI Builder and Data Dashboard

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving and Printing Files using Web UI

I have a LabVIEW app that decodes and then post-processes a file extracted from a camera. The file contains boot and history data that the user may want to save and/or print.

 

I need to convert this app to a thin-client since half of users run on Mac and the other half on PC's.

 

The issues that I am having are:

(1) The file to be post-processed resides on the client machine running the Web UI and I need to transfer this file to the server for processing - how can I transfer the file from client to server?

(2) The user can select a boot log within the file to edit, save and/or print - within the PC I can just launch Notepad but is there an equivalent capability with Silverlight since the Web UI does not know which OS is running? Is it possible to save the file locally? Is it possible to send the file to the default local printer?

 

I know that Silverlight 3.0 allows use of a Save Dialog box, how can I get access to that functionality? None of the saves are without user interaction since they must request to save or print a file from the Web UI.

0 Kudos
Message 1 of 14
(9,435 Views)

RG,

 

Please see this forum as it has good details covering alot of the file aspects you are looking for. 

http://forums.ni.com/t5/LabVIEW-Web-UI-Builder-and-Data/How-can-i-make-hyperlink-to-local-file-for-d...

 

You could read the file on the server and pass it to the web ui client.

 

Printing is another story. If they are networked printers (assuming multiple) then you ask the user which printer to print to and then pass that information back to the server and have the server, full LabVIEW, send to the printer.

 

Kyle Hartley
Senior Embedded Software Engineer

0 Kudos
Message 2 of 14
(9,425 Views)

Thanks.

 

I had looked at that thread and it appears to only work moving files one way (to the server).

 

How can I save any files created locally on the client machine? I am not sure the thread addresses this issue.

0 Kudos
Message 3 of 14
(9,423 Views)

1. Web UI Builder doesn't expose Silverlight's file open dialog right now. If you need to let the user be able to browse to a local file and upload it to the server. In order to do this with Web UI Builder, you'd probably need to make a hybrid HTML page (part Web UI Builder deployed application, part HTML forms). On the HTML side you could use a standard file upload form to get the file to the server. To access the file from a LabVIEW web service, this may help: http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/ws_post_form_upload/

 

2. Similarly, the file save dialog isn't exposed right now. However, you can write a web service that lets you access files from your LabVIEW server, and then sets the Content-Disposition header to trigger a file download. (GregR's responses in the thread Kyle linked should help with that.) In order to trigger the file download in UI Builder, you'd point the an instance of the Hyperlink Control's URL to that web service.

Message 4 of 14
(9,416 Views)

RG,

 

Sorry I misunderstood the path of your question. You could use the same method if the files were hosted again on the client computers using a http server. 

 

Could you use a list box to display data, edit, and then the user can press a button to push it back to the server? Are you set on using notepad or another program to modify the files?

Kyle Hartley
Senior Embedded Software Engineer

0 Kudos
Message 5 of 14
(9,412 Views)

I meant to edit my post look into HTTP post command to gather the file since you'll know the path of the file when you save it to the computer.

Kyle Hartley
Senior Embedded Software Engineer

0 Kudos
Message 6 of 14
(9,409 Views)

Hi Kyle,

 

They are not editing the file just using notepad or equivalent to view it since files can be rather long. Notepad allowed for searching the file or even printing it out.

 

I can use a listbox for displaying but no easy way to search but I will live with that right now as long as I can implement a way to to save file locally so that user can open file and manipulate/view or print it.

0 Kudos
Message 7 of 14
(9,407 Views)

Thanks Malcolm.

 

Let me see if I can get this implemented and see how it works.

 

It would be nice if the file dialog in Silverlight were exposed for use in Web UI. It would makes things a lot simpler

0 Kudos
Message 8 of 14
(9,404 Views)

I tried the link to the other posts but unable to get the either IE or Firefox to prompt to save the file. I have tried under latest version of IE and Firefox.

 

It copies the file but I never get the prompt to Save the file ... The Content-Disposition from HTTP forums say this should work.

 

I have code snippet in HTML file I wrote that verifies the browser prompts for file to save.

0 Kudos
Message 9 of 14
(9,390 Views)

RG,

 

Is it that your options in IE/Firefox are to automatically download the file?

 

In firefox go to options and under the general tab check to make sure it says prompt for each file download.

Kyle Hartley
Senior Embedded Software Engineer

0 Kudos
Message 10 of 14
(9,384 Views)