Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

[ Image Removed |../../index.htm#lansa/wamengt4_0840.htm]
You are here:

...

Sample RDMLX for Enhanced Documents List
Using file DXDOCS
Changes are highlighted in red italics.
Function Options(*DIRECT) Begin_Com Role(*EXTENDS #PRIM_WAM) Web_Map For(*BOTH) Fields((#stdrentry *hidden)) Group_By Name(#empdata) Fields(#EMPNO #SURNAME #GIVENAME #ADDRESS1 #ADDRESS2 #ADDRESS3 #POSTCODE #deptment #section)   Def_List Name(#doclist) Fields(#filename #df_elfnam (#prifilrrn *hidden)) Type(*Working) Define Field(#filename) Type(*char) Length(8) Webroutine Name(Begin) Web_Map For(*both) Fields(#empno) Web_Map For(*output) Fields((#fullname *out) (#address1 *out) (#address2 *out) (#address3 *out) (#postcode *out) (#deptment *out) (#section *out) #doclist) If (#stdrentry = S) Clr_List Named(#doclist) Fetch Fields(#empdata) From_File(pslmst) With_Key(#empno) #fullname := #givename + ', ' + #surname Select Fields(#df_elfnam) From_File(dxdocs) With_Key('DEM_ORG_SEC_EMP' #deptment #section #empno) Return_Rrn(#PRIFILRRN) #std_count := #df_elfnam.LastPositionOf( '.' ) #std_texts := #df_elfnam.substring( (#std_count + 1), 4 ) #filename := #std_texts.trim + '.gif' Add_Entry To_List(#doclist) Endselect Endif Endroutine   Webroutine Name(SEND_DOCUMENT) Response(#HTTPR) Desc('Sample Document') Web_Map For(*input) Fields(#PRIFILRRN)   Fetch Fields(#df_elfnam #dx_elblob) From_File(dxdocs) With_Rrn(#prifilrrn) #HTTPR.ContentFile := #DX_ELBLOB.FileName Endroutine End_Com
 
Not Using DXDOCS File
WAM running locally
Changes are highlighted in red italics.
Function Options(*DIRECT) Begin_Com Role(*EXTENDS #PRIM_WAM) Layoutweblet('iiilay01') Web_Map For(*BOTH) Fields((#stdrentry *hidden)) Group_By Name(#empdata) Fields(#EMPNO #SURNAME #GIVENAME #ADDRESS1 #ADDRESS2 #ADDRESS3 #POSTCODE #deptment #section)   Def_List Name(#doclist) Fields(#filename #df_elfnam) Type(*Working) Def_List Name(#mydocs) Fields(#std_textl) Type(*working)   Define Field(#filename) Type(*char) Length(8) Webroutine Name(Begin) Web_Map For(*both) Fields(#empno) Web_Map For(*output) Fields((#fullname *out) (#address1 *out) (#address2 *out) (#address3 *out) (#postcode *out) (#deptment *out) (#section *out) #doclist) Define Field(#retcode) Reffld(#io$sts) If (#stdrentry = S) Clr_List Named(#doclist) Fetch Fields(#empdata) From_File(pslmst) With_Key(#empno) #fullname := #givename + ', ' + #surname Use Builtin(transform_file) With_Args(#mydocs 'c:\Program Files (x86)\LANSA13\MYDOCS.txt') To_Get(#retcode) Selectlist Named(#mydocs) #df_elfnam := #std_textl.trim #std_count := #df_elfnam.LastPositionOf( '.' ) #std_texts := #df_elfnam.substring( (#std_count + 1), 4 ) #filename := #std_texts.trim + '.gif'   Add_Entry To_List(#doclist) Endselect Endif Endroutine   Webroutine Name(SEND_DOCUMENT) Response(#HTTPR) Desc('Sample Document') Web_Map For(*input) Fields(#DF_ELFNAM) #HTTPR.ContentFile := "C:\Program Files (x86)\LANSA13\" + #DF_ELFNAM Endroutine End_Com
 
WAM running on IBM i
Function Options(*DIRECT) Begin_Com Role(*EXTENDS #PRIM_WAM) Web_Map For(*BOTH) Fields((#stdrentry *hidden)) Group_By Name(#empdata) Fields(#EMPNO #SURNAME #GIVENAME #ADDRESS1 #ADDRESS2 #ADDRESS3 #POSTCODE #deptment #section)   Def_List Name(#doclist) Fields(#filename #df_elfnam (#prifilrrn *hidden)) Type(*Working) Define Field(#filename) Type(*char) Length(8) Webroutine Name(Begin) Web_Map For(*both) Fields(#empno) Web_Map For(*output) Fields((#fullname *out) (#address1 *out) (#address2 *out) (#address3 *out) (#postcode *out) (#deptment *out) (#section *out) #doclist) If (#stdrentry = S) Clr_List Named(#doclist) Fetch Fields(#empdata) From_File(pslmst) With_Key(#empno) #fullname := #givename + ', ' + #surname Select Fields(#df_elfnam) From_File(dxdocs) With_Key('DEM_ORG_SEC_EMP' #deptment #section #empno) Return_Rrn(#PRIFILRRN) #std_count := #df_elfnam.LastPositionOf( '.' ) #std_texts := #df_elfnam.substring( (#std_count + 1), 4 ) #filename := #std_texts.trim + '.gif' Add_Entry To_List(#doclist) Endselect Endif Endroutine   Webroutine Name(SEND_DOCUMENT) Response(#HTTPR) Desc('Sample Document') Web_Map For(*input) Fields(#PRIFILRRN) Fetch Fields(#df_elfnam #dx_elblob) From_File(dxdocs) With_Rrn(#prifilrrn) #HTTPR.ContentFile := #DX_ELBLOB.FileName Endroutine End_Com
 
[ Image Removed |../../index.htm#lansa/wamengt4_0840.htm]