Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fujitsu Cobol v6 and Listview

Status
Not open for further replies.

cardcoder

Programmer
Feb 2, 2004
14
0
0
GB
Hi Guys,

I am driving myself stupid with this problem.

I have a fully populated listview in report form that the user can click on each of the columns (7 of them) and sort based on each column.

I then want to be able to press a command button and take the details from each row and print them line by line. I have read the help / manuals / and examples - and I am still none the wiser.

Many Thanks.
 
cardcoder -

I'm not sure exactly where your problem lies. It would help to know exactly what you're unsure of.

That said, in populating the listview, you added listitems. To print the contents, you simply iterate through the listitems (varying the index from 1 to listitems.count) and print them out. To print out each listitem, you iterate through its subitems.

Regards.

Glenn
 
Glenn,

Below is my code for populating the listview. I want them to be able to sort the columns (working well) and then press the print button to create a report based on the new listing. e.g. what was originally in row one might now be in row 76.

Many Thanks for the prompt reply.

Mike


INVOKE ListView-2121-sav-dets "Add" USING 1 1 RETURNING ws-2121-count
MOVE "ListItems"(ws-2121-count) OF ListView-2121-sav-dets TO POW-PCMLIST
move plu-key to "Numeric"(1) OF POW-PCMLIST
move plu-name to "Text"(2) OF POW-PCMLIST
move plu-stock to "Numeric"(3) OF POW-PCMLIST
move plu-cost (1) to "Numeric"(4) OF POW-PCMLIST
compute ws-2121-line-total = plu-stock * plu-cost (1).
move ws-2121-line-total to "Numeric"(5) OF POW-PCMLIST
if plu-group > 0
move plu-group to "Numeric"(6) OF POW-PCMLIST
end-if.
if plu-vat-no > 0
move ws-vat (plu-vat-no) to "Numeric"(7) OF POW-PCMLIST
end-if.
go to a01-read-loop.
 
Hmmm - I've done this in AcuCOBOL, not Fujitsu, so the syntax looks a little strange to me. I think you want to (not syntactically/semantically correct, but should get you started):
Code:
PERFORM VARYING x from 1 by 1 
          UNTIL x > ws-2121-count
    MOVE "ListItems"(x) OF ListView-2121-sav-dets TO POW-PCMLIST
    MOVE "Item"(1) of POW-PCMLIST to plu-key
    move "Item"(2) of POW-PCMLIST to plu-name
    ...
END-PERFORM

Glenn
 
Glenn,

You are right. I checked the code to populate the listview (along wth your comments) and I think I have got it.

The examples are O.K. but they just stop short of giving you enough to make it sensible.

Thanks again,

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top