One correction - the Listbox appears when I use the Name. (The component built in an unused location when I tested your suggestion)
The listbox already appears in the current form, and does print as expected. However when the app is compiled as a component, and its method called from the Host, the values do not appear in the printout. It can be called from both apps by the shared "printLB" method. http://cdinc.co/Sample/LBPrint.zip <http://cdinc.co/Sample/LBPrint.zip> It just acts differently when "printLB" is called from a host. v16.1 Keith - CDI > On Aug 14, 2017, at 11:43 AM, Keisuke Miyako via 4D_Tech > <4d_tech@lists.4d.com> wrote: > > I am not sure I understand your code; > > are you not supposed to populate the arrays AFTER you call FORM LOAD (unless > the listbox already exists in the current form) ? > >> 2017/08/14 23:29、Keith Culotta via 4D_Tech <4d_tech@lists.4d.com> のメール: >> >> I tried with the name as well. It works that way too, but not when run as a >> component. >> >> SET PRINT PREVIEW(True) >> If (OK=1) >> >> ARRAY LONGINT(aA;0) >> ARRAY TEXT(aB;0) >> For ($i;1;10) >> APPEND TO ARRAY(aA;$i) >> APPEND TO ARRAY(aB;"Text"+String($i)) >> End for >> >> OPEN PRINTING JOB >> FORM LOAD("Form1") >> $all:=Print object(*;"ListBox") >> CLOSE PRINTING JOB >> >> End if > > > > > ********************************************************************** > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: http://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ********************************************************************** ********************************************************************** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **********************************************************************