{"id":7683,"date":"2019-10-30T15:33:40","date_gmt":"2019-10-30T22:33:40","guid":{"rendered":"https:\/\/minisoft.com\/support\/?p=7683"},"modified":"2019-10-30T15:39:17","modified_gmt":"2019-10-30T22:39:17","slug":"creating-a-listbox-of-printers-in-activeformz","status":"publish","type":"post","link":"https:\/\/c002.minisoft.com\/support\/creating-a-listbox-of-printers-in-activeformz\/","title":{"rendered":"Creating a Listbox of Printers in ActiveFORMz"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"801\" height=\"237\" src=\"https:\/\/minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-5.png\" alt=\"\" class=\"wp-image-7693\" srcset=\"https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-5.png 801w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-5-300x89.png 300w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-5-768x227.png 768w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-5-150x44.png 150w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-5-250x74.png 250w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-5-550x163.png 550w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-5-800x237.png 800w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-5-608x180.png 608w\" sizes=\"(max-width: 801px) 100vw, 801px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>On an ActiveFORMz page it is often useful to allow the user to select the printer they wish to print to from a ListBox.  Here is how to do that.<br><br>1.   Create a variable to hold your list of printers.  For example, <strong>AvailablePrinters<\/strong><br><br>2.  Use <strong>Add Function >> Concatenate<\/strong> and concatenate a new line ( &#8220;\\n&#8221;) character (for later use in listbox) to this variable<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"175\" height=\"49\" src=\"https:\/\/minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image.png\" alt=\"\" class=\"wp-image-7687\" srcset=\"https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image.png 175w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-150x42.png 150w\" sizes=\"(max-width: 175px) 100vw, 175px\" \/><\/figure>\n\n\n\n<p>3.  Create a variable to hold the list of printers for the ListBox display.  For example <strong>PrintersForListBox<\/strong>.<\/p>\n\n\n\n<p>4.  Create a procedure to load the list of printers. For example, &#8220;<strong>Load Printers for ListBox<\/strong>&#8220;.<\/p>\n\n\n\n<p>5.  In the Procedure, Add an Action and select <strong>&#8220;Printer List&#8221;.<\/strong><\/p>\n\n\n\n<p>6.  For the Format, you can specify a format type to filter out only printers that use that format, or you can leave it blank to display ALL system printers.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"706\" height=\"346\" src=\"https:\/\/minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-1.png\" alt=\"\" class=\"wp-image-7688\" srcset=\"https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-1.png 706w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-1-300x147.png 300w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-1-150x74.png 150w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-1-250x123.png 250w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-1-550x270.png 550w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-1-367x180.png 367w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-1-612x300.png 612w\" sizes=\"(max-width: 706px) 100vw, 706px\" \/><\/figure>\n\n\n\n<p>7.  Next to Printer Information, Click NEW to map an attribute to a variable.  Choose the attribute you want to map (Printer Name, Format, or Device) and select the Variable you want to map to.   In this example, we are  mapping <strong>Printer name<\/strong> to the variable <strong>AvailablePrinters.<\/strong>  This will create an array in your variable containing all of the options of the attribute you&#8217;ve selected. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"450\" height=\"323\" src=\"https:\/\/minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-2.png\" alt=\"\" class=\"wp-image-7689\" srcset=\"https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-2.png 450w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-2-300x215.png 300w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-2-150x108.png 150w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-2-250x179.png 250w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-2-251x180.png 251w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-2-418x300.png 418w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-2-210x150.png 210w\" sizes=\"(max-width: 450px) 100vw, 450px\" \/><figcaption><br><br><\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"524\" height=\"42\" src=\"https:\/\/minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-3.png\" alt=\"\" class=\"wp-image-7690\" srcset=\"https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-3.png 524w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-3-300x24.png 300w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-3-150x12.png 150w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-3-250x20.png 250w\" sizes=\"(max-width: 524px) 100vw, 524px\" \/><\/figure>\n\n\n\n<p>8.  To put this into a usable format for an ActiveFORMz ListBox, you can now use the Bulk Concatenate function to store the values in your variable that will be used to display the printer options in ListBox format.  In this example, after the Bulk Concatenate function is used, we store the result in our <strong>PrintersForListBox <\/strong>variable.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"665\" height=\"237\" src=\"https:\/\/minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-4.png\" alt=\"\" class=\"wp-image-7691\" srcset=\"https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-4.png 665w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-4-300x107.png 300w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-4-150x53.png 150w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-4-250x89.png 250w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-4-550x196.png 550w, https:\/\/c002.minisoft.com\/support\/wp-content\/uploads\/2019\/10\/image-4-505x180.png 505w\" sizes=\"(max-width: 665px) 100vw, 665px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>On an ActiveFORMz page it is often useful to allow the user to select the printer they wish to print to from a ListBox. Here is how to do that. 1. Create a variable to hold your list of printers. For example, AvailablePrinters 2. Use Add Function >> Concatenate and concatenate a new line ( [&hellip;]<\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/posts\/7683"}],"collection":[{"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/comments?post=7683"}],"version-history":[{"count":2,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/posts\/7683\/revisions"}],"predecessor-version":[{"id":7694,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/posts\/7683\/revisions\/7694"}],"wp:attachment":[{"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/media?parent=7683"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/categories?post=7683"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/c002.minisoft.com\/support\/wp-json\/wp\/v2\/tags?post=7683"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}