The Create a Table Field dialog is used to configure settings needed to print a table in MarkMagic PI.  Tables are a new feature that allow a user to print structured JSON array of object data as a standalone table.  Currently, table fields are only supported on MarkMagic Zebra drivers as well as the PDF driver.  Table fields will automatically size and center data using the Zebra Outline font 0051 within the individual table elements.  The user has control over the number of rows and columns that the table will have.



Properties


Name and Description


  • Field Name - Please see Field Names for more information.
  • Browse...
  • Field # - An automatically assigned number for the field.  This is an internally used number for list ordering and field identification.
  • Description - Optional 350 character max description for the table field.



Positioning Properties



When placing a Table field on a format, the bottom left corner of the table is treated as the origin point.


  • Row - The Row or Y position on the format.
  • Column - The Column or X position on the format.



Table Properties



  • Display Header - Whether or not to print the static header row containing the column names.
  • Dynamic # of Rows - If checked, MarkMagic will automatically print new rows on bottom of the table as more and more JSON objects are added to the input data.  If the physical end of the page is reached, MarkMagic will automatically print a new page to accommodate the added rows.  If left unchecked, MarkMagic will only print the defined Number of Rows no matter how many extra JSON objects there might be in the input data.  Those extra objects are discarded.
  • Number of Rows - Defines the number of Rows in the table.
  • Number of Columns - Defines the number of Columns in the table.
  • Row Height - Defines the default height of each row.  This value is used if no custom height is defined for a row in the Row Settings section.
  • Column Width - Defines the width of each column.  This value is used if no custom width is defined for a column in the Column Settings section.
  • Font - The font used for printing the table data.  Currently, only Zebra Outline font 0051 is supported.


Column Settings


The Column Settings section allows the user to customize the individual column names as well as the column widths on a per-column basis.  If Display Header is checked above, Name is printed at the top of the column.  If a custom Column Width is defined here, then that value is used over the base default width defined above in Column Width.


Row Settings


The Row Settings section allows the user to customize the individual row heights a per-row basis.  If a custom Row Height is defined here, then that value is used over the base default height defined above in Row Height.


Data Formatting Considerations


As with regular JSON structured data that is passed to MarkMagic for printing (see Work With JSON Files), table fields are also defined as an object with "FIELDNAME" and "DATA". In the table's "DATA" section is where a new array of objects can be defined.  Each object being a row of information for the table.


Below is an example JSON file that contains information for the table defined in the screenshot above called "TABLE1".  Note the subsequent "DATA" section and the array of objects providing information for the three columns of data.  The table will print six rows worth of information.  See below for the JMagic design view of a simple label with a plain text variable



JMagic Designer view of a label with a simple variable text field called TEXT and a table as designed above.



Resulting print below using the JSON data defined above.  Note that even though six rows worth of information was passed, only the three printed.  This is because Dynamic # of Rows was not checked.



With Dynamic # of Rows checked, running the same exact print job using the same JSON data as before, we see drastically different results.  MarkMagic automatically grew the table to the maximum length of the page and then create a new page to fill the remaining rows of information.