cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP 19 is here! See the new features at jmp.com/new.
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
Choose Language Hide Translation Bar
JMP Tables and Tabulates Stylized in DOCX

JMP is an incredibly powerful tool for analyzing and wrangling data. Specifically, the Tabulate platform and the many other platforms that produce embedded tables enable users to quickly and easily generate summaries and insights. It is often common that users want to embed these tables in Microsoft Word or Apache’s OpenOffice or LibreOffice. All of these authoring tools can read and write the Office Open XML standard - in particular, DOCX files.

The add-in I’ve created for this post is meant to facilitate getting your tabular output from your JMP session into a DOCX file and take advantage of all of the formatting and stylization capabilities. The add-in uses the python-docx package (https://pypi.org/project/python-docx/) and the JMP/Python integration to accomplish this task. Additionally, a previously created DOCX file with an existing stylized table can be specified enabling the user to create templates for the formatting to use for the JMP table. Finally, if the template DOCX contains “tags” (text in the document that starts with ${JMP_ and ends with a }, e.g. ${JMP_TABLE1}) the add-in will embed the table where the tag exists.

The add-in is written with a standalone function that can be called from outside of the UI giving users the ability to incorporate the creation of the DOCX tables into new or existing workflow processes.

Tabulate to DOCX Table UI

Installing the add-in to your JMP session will install the python-docx package into your JMP Python environment and create a menu item in the Add-Ins menu:drewfoglia_6-1758310583939.png Clicking that menu item will launch the UI and gather a list of all of the tables and tabulates in your JMP session.

 

 
drewfoglia_1-1758310311959.png

 

If you subsequently open any new tables or create new tabulates after launching the UI, you can click the refresh button to update the list. Selecting one of the tables/tabulates in the list will give a thumbnail image of the selection. If no template DOCX file is selected, the DOCX table will get generated without any styling applied:

 

drewfoglia_2-1758310395986.png

 

The Browse button will let you select a DOCX to use as a template. The add-in delivers 4 sample template DOCX files and copies them into your DOCUMENTS folder. The View button will open the selected template DOCX in whatever application is your default for viewing/editing DOCX files. The TabulateToDocxTableTemplate1.docx file contains the following stylized table:

 

drewfoglia_3-1758310450263.png

Using that template, the generated output now looks like:

 

drewfoglia_4-1758310507234.png

 

TabulateToDocxTableTemplate2 and 3 are simply different table stylings.

drewfoglia_7-1758310686660.png
drewfoglia_8-1758310715327.png

 

 

The fourth template demonstrates the tagging capability. When that template is selected, a new option is enabled in the UI letting you select which tag to insert the table into.

drewfoglia_9-1758310770690.png

 

Now, instead of creating an empty document with just the stylized table, it is inserted into the document at the tag location using the table styling in the paragraph just after the tag:

drewfoglia_10-1758310798326.png

 

As mentioned above, with the add-in stalled this functionality also exists as a standalone function that can be called from other JSL processes. The arguments are described below:

// TabulateToDocxTable:createDocxTable is a function that uses Python to generate a three-line DOCX version of a JMP Tabulate.
//
// tb -             required - a reference to a JMP Table, TabulateBox (DisplayBox), or a Tabulate platform
// templatePath -	optional - a string for the path of a DOCX file from which to glean the table styling (default Empty() - use the default styling)
// tag - 			optional - a string for the ${...} enclosed text in the DOCX template that the rendered table will replace. Specifying this option will first copy the DOCX
//							   into the outputFilePath and modify that copy of the DOCX
// outputFilePath - optional - a string for the path where to write the DOCX file (default "$DOCUMENTS/JMPDocxTable.docx" - JMPDocxTable.docx in the user's Documents folder)
//
TabulateToDocxTable:createDocxTable = function({tb, templatePath=Empty(), tag=Empty(), outputFilePath=Empty()})

 

The add-in will work on JMP versions 18 and 19 and on Windows and Mac platforms.


We Want Your Feedback!

We’re trying something a little different and would love to hear your thoughts on this functionality. After you’ve had a chance to explore the add-in, please take a moment to fill out the following survey.

Last Modified: Sep 19, 2025 5:04 PM