Skip to main content

I have another client using Reflection and I am looking into the possibility of using it's VBA interface to display a grid control with say 100 lines of data.  I would like the end-user to select one of those lines and return which row number the user selected back to the legacy system.  So can the legacy system launch the control and then retrieve the row selected?

 

Thanks

Karl


#Rumba

I have another client using Reflection and I am looking into the possibility of using it's VBA interface to display a grid control with say 100 lines of data.  I would like the end-user to select one of those lines and return which row number the user selected back to the legacy system.  So can the legacy system launch the control and then retrieve the row selected?

 

Thanks

Karl


#Rumba

Hi Karl,

First off there is a different Forum for Reflection: https://forums.novell.com/forumdisplay.php/1395-Reflection 

Not sure what you mean by "So the legacy system can launch the control and then retrieve the row selected?"

Are we talking about a VT host or an IBM host here?

Below is some code which use the "Microsoft ListView Control, version 6" on my form, also I have two buttons, one to read the selected listitem and a second to close the form. I've also added an event to highlight the selected listitem.

Dim ActiveListItem As Integer

Private Sub CommandButton2_Click()

   Unload Me

End Sub

Private Sub ListView1_Click()

   Dim ListItem1 As ListItem, i As Integer

   For i = 1 To ListView1.ListItems.Count

       ListView1.ListItems.Item(i).Bold = False

       ListView1.ListItems.Item(i).ListSubItems.Item(1).Bold = False

       ListView1.ListItems.Item(i).ListSubItems.Item(2).Bold = False

   Next i

   ActiveListItem = ListView1.SelectedItem.Index

   Me.Repaint

   ListView1.SelectedItem.Selected = False

   ListView1.ListItems.Item(ActiveListItem).Bold = True

   ListView1.ListItems.Item(ActiveListItem).ListSubItems.Item(1).Bold = True

   ListView1.ListItems.Item(ActiveListItem).ListSubItems.Item(2).Bold = True

End Sub

Private Sub UserForm_Initialize()

   Dim ListItem1 As ListItem, i As Integer

   ListView1.Gridlines = True

   ListView1.View = lvwReport

   ListView1.ColumnHeaders.Add Index:=1, Width:=40, text:="Karl"

   ListView1.ColumnHeaders.Add Index:=2, Width:=50, text:="Pozmann"

   ListView1.ColumnHeaders.Add Index:=3, Width:=60, text:="was here"

   For i = 1 To 100

   Set ListItem1 = ListView1.ListItems.Add(text:="Key " & i)

   ListItem1.ListSubItems.Add text:="row " & i

   ListItem1.ListSubItems.Add text:="of data"

   Next i

End Sub

Private Sub CommandButton1_Click()

   MsgBox ListView1.ListItems.Item(ActiveListItem).ListSubItems.Item(1).text & " " & Chr$(13) & Chr$(10) _

        & ListView1.ListItems.Item(ActiveListItem).ListSubItems.Item(2).text, Title:=ListView1.ListItems.Item(ActiveListItem).text

End Sub

This should allow you to list your data, and to read the users selection, then you can send what you need to the host. Then we can work on the part I don't quite understand.

Note: The above will also work in Rumba VBA, so leaving this here for demo purposes.


I have another client using Reflection and I am looking into the possibility of using it's VBA interface to display a grid control with say 100 lines of data.  I would like the end-user to select one of those lines and return which row number the user selected back to the legacy system.  So can the legacy system launch the control and then retrieve the row selected?

 

Thanks

Karl


#Rumba
That was quick! Thanks Tom - I think this might work. It is for a Unix based system so it's VT. My questions are:

1. Is there a way to launch the code you've created with a command from the host legacy system

and

2. How does it get populated with the data I have on the host?

Also not clear on how to read the user's selection

Thanks

Karl

I have another client using Reflection and I am looking into the possibility of using it's VBA interface to display a grid control with say 100 lines of data.  I would like the end-user to select one of those lines and return which row number the user selected back to the legacy system.  So can the legacy system launch the control and then retrieve the row selected?

 

Thanks

Karl


#Rumba
Also - if you could let me know whether or not it's doable today that would be awesome - don't need the code - just if it is doable. As an aside would it also work in an IBM AS400 environment?

I have another client using Reflection and I am looking into the possibility of using it's VBA interface to display a grid control with say 100 lines of data.  I would like the end-user to select one of those lines and return which row number the user selected back to the legacy system.  So can the legacy system launch the control and then retrieve the row selected?

 

Thanks

Karl


#Rumba
Hi Karl,

1. How to read the users selection
The Command_Button1 Msgbox Title string is the users selection (i.e. the First column in the ListView control) and the content of the msgbox is the other columns in that row of the ListView.

2. Is there a way to trigger a macro from the host in Reflection for Unix OpenVMS, yes. ow to deal with this depends on whether you are using Legacy Reflection 14.y or next generation Reflection 2XXX/16.x.

3. You can send the data from the host and pass it into your routine, you just need to decide on delimiters to separate the columns and rows.

4. Is this possible for 5250 terminal session in Reflection yes I believe so, but it would be little more complicated as we don't have a mechanism to intercept the host data stream in IBM sessions. For IBM sessions we may need to download the host data which you want to display in the ListView using FTP.

5. I won't go into the details he as this is the Rumba forum, please open a ticket with support and have them let me know the ticket number.

Tom

I have another client using Reflection and I am looking into the possibility of using it's VBA interface to display a grid control with say 100 lines of data.  I would like the end-user to select one of those lines and return which row number the user selected back to the legacy system.  So can the legacy system launch the control and then retrieve the row selected?

 

Thanks

Karl


#Rumba
They are using ReflectionDT 16.0.399 Version 16.0 SP1 - will all this fly on that? That is all I need to know to see if they want to go this route and if they do I'll open that ticket.....

I have another client using Reflection and I am looking into the possibility of using it's VBA interface to display a grid control with say 100 lines of data.  I would like the end-user to select one of those lines and return which row number the user selected back to the legacy system.  So can the legacy system launch the control and then retrieve the row selected?

 

Thanks

Karl


#Rumba
Hi Karl,

Again in terms of the Reflection VBA

On the VT front:
yes, we can get that working.

On the 5250 front:
We would need to use FTP (or BFT) to get the host data (so populate the listview) from the host.
We would need a specific host screen to automatically trigger the macro execution, alternatively the user
would need to click off the macro execution manually.

Tom