Page 1 of 1

Integrator PDFDocumentService List Element

Posted: Fri Jun 15, 2018 5:08 am
by jyoung
How do I get a list populated in the PDFDocumentService?

I have content in my template like this to show a list of address lines

Code: Select all

  <content name="Address">
    <list x1="20" y1="760" symbol="bullet" width="200" horizontal-align="left" style="header">
      <item value="{STD_STRNG}" />
    </list>
  </content>
I add the content with

Code: Select all

#JSMXCMD := ('ADD CONTENT(ADDRESS)')
#SYS_APPLN.TraceMessageData( "Executing &1" #JSMXCMD )
use builtin(JSMX_COMMAND) with_args(#JSMXHDLE #JSMXCMD) to_get(#JSMXSTS #JSMXMSG #AddressLines)
if (#COM_OWNER.CheckStatus( #JSMXSTS #JSMXMSG ) = ER)
return
endif
Where #AddressLines is defined as

Code: Select all

def_list name(#AddressLines) fields(#STD_STRNG) type(*WORKING) entrys(4)
There are entries in the list.

The Trace Shows

Code: Select all

Process    : ASCCHIR01
Function   : ASCCHI2
Partition  : SYS
Job Name   : JOB010008
Job User   : LANSA
Job Number : 010008
Command    : ADD CONTENT(ADDRESS)
Add content : ADDRESS

Add list
X1 : 20
Y1 : 760
Style : header
Width : 200
Field : 
Cannot access program field : STD_STRNG
Add list completed
Command    : OK ""
What is meant by "Cannot access program field"? How do I get this list populated?

EDIT
If I define the template list like this

Code: Select all

  <content name="Address">
    <list x1="20" y1="760" symbol="bullet" width="200" horizontal-align="left" style="header" field="STD_STRNG" />
  </content>
I don't get an error in the trace

Code: Select all

Process    : ASCCHIR01
Function   : ASCCHI2
Partition  : SYS
Job Name   : JOB008220
Job User   : LANSA
Job Number : 008220
Command    : ADD CONTENT(ADDRESS)
Add content : ADDRESS

Add list
X1 : 20
Y1 : 760
Style : header
Width : 200
Field : STD_STRNG
Field index : 0
Add list completed
Command    : OK ""
And the list still is still missing.

If I define the list like (note the {} around STD_STRNG)

Code: Select all

  <content name="Address">
    <list x1="20" y1="760" symbol="bullet" width="200" horizontal-align="left" style="header" field="{STD_STRNG}" />
  </content>
I get the same error as above.

Re: Integrator PDFDocumentService List Element

Posted: Mon Jun 18, 2018 10:40 am
by alick
Hi,

Specify the working list field on the list element.

<list x1="20" y1="760" symbol="bullet" field="STD_STRING" width="200" horizontal-align="left" style="header">

Each working list entry for that field will become an item in the PDF list.

Cheers

Alick