LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write pdf-file name list to indicator and choose to open one.

Solved!
Go to solution

Hello

 

How can I write a pdf-file name list to indicator and choose to open one? Se attached pic. Top field is for automatic searching of pdf reports by letters. List under will update. This is OK, I know how to do this. But in pdf list it's possible to choose report and open it. How can this be done? 

 

br,

paalbrok 

 

Program.png

0 Kudos
Message 1 of 7
(3,030 Views)

Opening an Adobe™ Acrobat™ PDF File From LabVIEW?:

http://digital.ni.com/public.nsf/allkb/9A6A259EB5A2BEDA86256DD00048C604

or

How Can I Open a Document in its Default Application Using LabVIEW?:

http://digital.ni.com/public.nsf/allkb/68A6F2A00872837E862576940059C142

0 Kudos
Message 2 of 7
(2,986 Views)

I think you misunderstand. I want to open a pdf document from an indicator when they are listed there. If it's a pdf or whatever is irrelevant for my question. I should use my mouse button to choose the document in indicator, highlight it and then open it. In the program, it's done with the button under list (see pic).

 

What function can do this?

 

br,

paalbrok

0 Kudos
Message 3 of 7
(2,977 Views)
Solution
Accepted by paalbrok

It sounds like what you're asking is how to choose the item?

 

If the list is an array of strings indicator, you'll have difficulty - I think you'd need to trap the mouse down (or up) event and then get the item from the mouse coordinates, which would be potentially frustrating to code.

 

If instead you're using a listbox (or multicolumn listbox, which it doesn't look like), then so long as it is a Control, and not an Indicator, you should have no problem. The 'Value Change' event will tell you when a new item is selected, and the value is the index of the list item. You can set the value of the strings using the Item Names property, which accepts an array of strings.

 

Once you have the index of the item, you can use Index Array with the Item Names property to get the value of the string clicked, and then use that to open your file (which it sounds like you don't need help with?).

 

A simple example is attached.

vchange.png

 


GCentral
Message 4 of 7
(2,972 Views)

Great! This works perfectly. Thank you. Another question: How can I adjust the size of text automatically in all the cells of listbox. Some property node?

 

br,

paalbrok

0 Kudos
Message 5 of 7
(2,966 Views)
Solution
Accepted by paalbrok

If you want to change the font size, I think you should use a property node with two elements, 'Active Row' and 'CellFontSize', which are both under the Active Row section.

 

If you set Active Row = -2, then it will set all rows (-1 is the header, and 0+ are specific rows). The same is true for a Multicolumn Listbox (and you can use -2,-2 to get all cells there).


GCentral
Message 6 of 7
(2,962 Views)

Thank you for your help.

 

br,

paalbrok

0 Kudos
Message 7 of 7
(2,957 Views)