<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Help using &amp;quot;get format&amp;quot; for making a PDF from a data table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Help-using-quot-get-format-quot-for-making-a-PDF-from-a-data/m-p/881274#M104525</link>
    <description>&lt;P&gt;Thanks for the help&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;
&lt;P&gt;So where I am stuck now is the formatting of the date column. Using your help I have the script to here (haven't switched over to AA's yet) and this works great except being able to format the dates:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;		dty=current data table();
		createdate=today();
		
		column_names=dty&amp;lt;&amp;lt;get column names("string");
		qty_of_rows=N Rows(dty);

		
		col_var_list={};
		var_list={};
		col_list={};
		col_format={};
		col_format_text={};
		col_width={};
		col_wrap={};
		col_for={};
		col_for2={};

// Loop through each column name
For Each({col_name}, column_names,
	col = Column(dty, col_name);
	col_for2=(col&amp;lt;&amp;lt; Get Format);
	col_for=char(col&amp;lt;&amp;lt; Get Format());

	
	insertinto(col_format,Name Expr(col_for2));
	insertinto(col_width,col&amp;lt;&amp;lt; Get Display Width);
	insertinto(col_wrap,col &amp;lt;&amp;lt; Get Display Width);

);

		for(i=1, i&amp;lt;=n items(column_names), i++,
			col_var_list[i]=column(dty,column_names[i])&amp;lt;&amp;lt; Get Values;;
		);

		nw = New Window( "PDF Print of PVNs",
			tb = Table Box()			
		);
		
		for(i=1, i&amp;lt;=n items(column_names), i++,
			tb &amp;lt;&amp;lt; append( col_list[i]=col Box(column_names[i]));
		);
		
		for(j=1, j&amp;lt;=n items(column_names), j++,
				For(i=1,i&amp;lt;= qty_of_rows, i++,
						col_list[j] &amp;lt;&amp;lt; append(Text Box(col_var_list[j][i],&amp;lt;&amp;lt;set width(col_width[j]), &amp;lt;&amp;lt; set wrap (col_wrap[j])));
						col_list[j] &amp;lt;&amp;lt; append(Text Box(col_var_list[j][i],&amp;lt;&amp;lt;set width(col_width[j]), &amp;lt;&amp;lt; set wrap (col_wrap[j])));
					);
				);
			
		tb &amp;lt;&amp;lt; Set Shade Alternate Rows( 1 );
		tb &amp;lt;&amp;lt; Set Row Borders( 1 );
		tb &amp;lt;&amp;lt; Set Row Borders( 1 );
		tb &amp;lt;&amp;lt; Set Column Borders( 1 );

		wajrn = Window( "example file" );
		wajrn &amp;lt;&amp;lt; journal;
		wajrn=Current Journal();
		wajrn &amp;lt;&amp;lt; Show Window( 0 );

		wajrn &amp;lt;&amp;lt;Set page setup(
			margins( .1, .1, .1, .1 ),
			scale( .8 ),
			portrait( 0 ),
			paper size( "Letter" ) 
		  );
		  wajrn &amp;lt;&amp;lt; Set Print Headers(""/*left*/, ""/*center*/,""/*right*/);
		  wajrn &amp;lt;&amp;lt; Set Print Footers(""/*left*/, ""/*center*/,"Updated on " || char(MDYHMS(createdate)));
		  
		//wajrn &amp;lt;&amp;lt;Save PDF("Put in file location here");
		
		wajrn&amp;lt;&amp;lt;close window;
		nw&amp;lt;&amp;lt;close window;	&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shampton82_0-1750820783277.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/77298i3CD2CDA2BA5A6011/image-size/medium?v=v2&amp;amp;px=400" role="button" title="shampton82_0-1750820783277.png" alt="shampton82_0-1750820783277.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I was using this before to format it:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;col2 &amp;lt;&amp;lt; append( Text Box(Format(coval[i],"Format Pattern", "&amp;lt;YYYY&amp;gt;&amp;lt;/&amp;gt;&amp;lt;MM&amp;gt;&amp;lt;/&amp;gt;&amp;lt;DD&amp;gt; &amp;lt;hh24&amp;gt;&amp;lt;:&amp;gt;&amp;lt;mm&amp;gt;"),&amp;lt;&amp;lt;set width(100)));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but this code does not work well with what is being pulled from the&amp;nbsp; "Get Format" function from the data table as it returns something that would use &amp;lt;&amp;lt;set format&amp;nbsp; where as I need to use format(x,formatstring,&amp;lt;options&amp;gt;) per above and I can't figure out how to get just the string part of what is returned from Get Format.&amp;nbsp; I tried this:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;col_for=char(col&amp;lt;&amp;lt; Get Format());&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and while it comes in as a string it has a bunch of \! in it like this ("Format(\!"m/d/y h:m:s\!", 27, 3)") .&amp;nbsp; Any to get rid of them?&amp;nbsp; I'm thinking so type of regex?&amp;nbsp; Once they are gone I think I can use that in the Format() function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jun 2025 03:18:10 GMT</pubDate>
    <dc:creator>shampton82</dc:creator>
    <dc:date>2025-06-25T03:18:10Z</dc:date>
    <item>
      <title>Help using "get format" for making a PDF from a data table</title>
      <link>https://community.jmp.com/t5/Discussions/Help-using-quot-get-format-quot-for-making-a-PDF-from-a-data/m-p/881062#M104494</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;I have a script where I am trying to get the format of a column and then apply that to a textbox that is in a table box.&lt;/P&gt;
&lt;P&gt;I tried using this&amp;nbsp;&lt;SPAN&gt; col_for=col&amp;lt;&amp;lt; Get Format; but I can't use what it returns in this loop&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For Each({col_name}, column_names,
	col = Column(dty, col_name);
	col_for=(col&amp;lt;&amp;lt; Get Format);

	
	insertinto(col_format_text,col_for);
	insertinto(col_width,col&amp;lt;&amp;lt; Get Display Width);
	insertinto(col_wrap,col &amp;lt;&amp;lt; Get Display Width);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;I get an error when&amp;nbsp; I try and add the col_for into the list.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The reason I am doing this is that I am later trying to use the list to set the textbox format later with this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;		for(j=1, j&amp;lt;=n items(column_names), j++,
				For(i=1,i&amp;lt;= qty_of_rows, i++,
						col_list[j] &amp;lt;&amp;lt; append(Text Box(col_var_list[j][i]),&amp;lt;&amp;lt;set format(col_format[j]),&amp;lt;&amp;lt;set width(col_width[j]), &amp;lt;&amp;lt; set wrap (col_width[j]));
					);
				);
			
		);
		tb &amp;lt;&amp;lt; Set Shade Alternate Rows( 1 );
		tb &amp;lt;&amp;lt; Set Row Borders( 1 );
		tb &amp;lt;&amp;lt; Set Row Borders( 1 );
		tb &amp;lt;&amp;lt; Set Column Borders( 1 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;The full script I am working on is this and the intent is to be able to easily save a data table to a PDF for printing.&amp;nbsp; This would grab the formatting of the data table and apply it to the&amp;nbsp;table box columns:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dty=current data table();
		createdate=today();
		
		column_names=dty&amp;lt;&amp;lt;get column names("string");
		qty_of_rows=N Rows(dty);

		
		col_var_list={};
		var_list={};
		col_list={};
		col_format={};
		col_format_text={};
		col_width={};
		col_wrap={};
		col_for={};
		col_for2={};

// Loop through each column name
For Each({col_name}, column_names,
	col = Column(dty, col_name);
	col_for=(col&amp;lt;&amp;lt; Get Format);

	
	insertinto(col_format_text,col_for);
	insertinto(col_width,col&amp;lt;&amp;lt; Get Display Width);
	insertinto(col_wrap,col &amp;lt;&amp;lt; Get Display Width);
);

		

//old way that was not dynamic, had to set up each line 
/*

		qnval=dty:"QN Number"n &amp;lt;&amp;lt; Get Values;
		coval = dty:"Created On"n &amp;lt;&amp;lt; Get Values;
		wonval = dty:"Workorder"n &amp;lt;&amp;lt; Get Values;
		opval = dty:"Dept"n &amp;lt;&amp;lt; Get Values;
		ccval = dty:"Cause Category"n &amp;lt;&amp;lt; Get Values;
		dovval = dty:"Description of Variation"n &amp;lt;&amp;lt; Get Values;
		vcval = dty:"Variation Comment"n &amp;lt;&amp;lt; Get Values;
		sval = dty:"Severity"n &amp;lt;&amp;lt; Get Values;
*/		

		for(i=1, i&amp;lt;=n items(column_names), i++,
			col_var_list[i]=column(dty,column_names[i])&amp;lt;&amp;lt; Get Values;;
		);

//old way that was not dynamic, had to set up each line 
/*
		nw = New Window( "PDF Print of PVNs",&amp;lt;&amp;lt;window view("invisible"),
			tb = Table Box(
				col1 = Col Box( "QN Number" ),
				col2 = Col Box( "Created On"),
				col3 = Col Box( "Workorder"),
				col4 = Col Box( "Dept"),
				col5 = Col Box( "Severity"),
				col6 = Col Box( "Description of Variation"),
				col7 = Col Box( "Narrative Cause"),
				col8 = Col Box( "Variation Comment")
			)
		);
*/	
		nw = New Window( "PDF Print of PVNs",
			tb = Table Box()
						
		);
		for(i=1, i&amp;lt;=n items(column_names), i++,
			tb &amp;lt;&amp;lt; append( col_list[i]=col Box(column_names[i]));
		);

//old way that was not dynamic, had to set up each line 		
/*
		For Each ({value, i}, qnval,
			col1 &amp;lt;&amp;lt; append( Text Box(qnval[i]));
			col2 &amp;lt;&amp;lt; append( Text Box(Format(coval[i],"Format Pattern", "&amp;lt;YYYY&amp;gt;&amp;lt;/&amp;gt;&amp;lt;MM&amp;gt;&amp;lt;/&amp;gt;&amp;lt;DD&amp;gt; &amp;lt;hh24&amp;gt;&amp;lt;:&amp;gt;&amp;lt;mm&amp;gt;"),&amp;lt;&amp;lt;set width(100)));
			col3 &amp;lt;&amp;lt; append( Text Box(wonval[i]));
			col4 &amp;lt;&amp;lt; append( Text Box(opval[i]));
			col5 &amp;lt;&amp;lt; append( Text Box(sval[i]));
			col6 &amp;lt;&amp;lt; append( Text Box(ccval [i], &amp;lt;&amp;lt; set wrap (150)));
			col7 &amp;lt;&amp;lt; append( Text Box(dovval[i], &amp;lt;&amp;lt; set wrap (325)));
			col8 &amp;lt;&amp;lt; append( Text Box(vcval[i], &amp;lt;&amp;lt; set wrap (325)));
			
		);
		
*/
		for(j=1, j&amp;lt;=n items(column_names), j++,
				For(i=1,i&amp;lt;= qty_of_rows, i++,
						col_list[j] &amp;lt;&amp;lt; append(Text Box(col_var_list[j][i]),&amp;lt;&amp;lt;set format(col_format[j]),&amp;lt;&amp;lt;set width(col_width[j]), &amp;lt;&amp;lt; set wrap (col_wrap[j]));
					);
				);
			
		);
		tb &amp;lt;&amp;lt; Set Shade Alternate Rows( 1 );
		tb &amp;lt;&amp;lt; Set Row Borders( 1 );
		tb &amp;lt;&amp;lt; Set Row Borders( 1 );
		tb &amp;lt;&amp;lt; Set Column Borders( 1 );

		wajrn = Window( "example file" );
		wajrn &amp;lt;&amp;lt; journal;
		wajrn=Current Journal();
		wajrn &amp;lt;&amp;lt; Show Window( 0 );

		wajrn &amp;lt;&amp;lt;Set page setup(
			margins( .1, .1, .1, .1 ),
			scale( .8 ),
			portrait( 0 ),
			paper size( "Letter" ) 
		  );
		  wajrn &amp;lt;&amp;lt; Set Print Headers(""/*left*/, ""/*center*/,""/*right*/);
		  wajrn &amp;lt;&amp;lt; Set Print Footers(""/*left*/, ""/*center*/,"Updated on " || char(MDYHMS(createdate)));
		  
		//wajrn &amp;lt;&amp;lt;Save PDF("Put in file location here");
		
		wajrn&amp;lt;&amp;lt;close window;
		nw&amp;lt;&amp;lt;close window;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;I attached a table that I have been working with along with this script.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks for any help!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 02:37:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-using-quot-get-format-quot-for-making-a-PDF-from-a-data/m-p/881062#M104494</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2025-06-24T02:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help using "get format" for making a PDF from a data table</title>
      <link>https://community.jmp.com/t5/Discussions/Help-using-quot-get-format-quot-for-making-a-PDF-from-a-data/m-p/881084#M104496</link>
      <description>&lt;P&gt;&amp;lt;&amp;lt; Get Format returns format expression which is causing issues when you add it to the list using Insert Into. You could wrap it with Name Expr&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

myformat = Column(dt, "name") &amp;lt;&amp;lt; get format;

res = {};
Try(
	Insert Into(res, myformat);
,
	show(exception_msg);
);

// Wrap it with Name Expr
Insert Into(res, Name Expr(myformat));

show(res);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also, I would suggest using Associative Array instead of lists as they tend to be easier to read and manage in cases like this.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2025 04:42:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-using-quot-get-format-quot-for-making-a-PDF-from-a-data/m-p/881084#M104496</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-06-24T04:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help using "get format" for making a PDF from a data table</title>
      <link>https://community.jmp.com/t5/Discussions/Help-using-quot-get-format-quot-for-making-a-PDF-from-a-data/m-p/881095#M104499</link>
      <description>&lt;P&gt;Also, I don't think Text Box() has a format property as it is just text -&amp;gt; you will have to format the text you are inputting to the text box.&lt;/P&gt;
&lt;P&gt;Edit:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");
aa = Associative Array();

For Each({colname}, dt &amp;lt;&amp;lt; Get Column Names("String"),
	f = Column(dt, colname) &amp;lt;&amp;lt; get format;
	aa[colname] = Name Expr(f);
);

For Each({{colname, f_expr}}, aa,
	val = dt[1, colname];
	Try(
		r = Eval(Insert(Name Expr(f_expr), val, 1));
		Write("\!N\!NCol: \!"", colname, "\!" value: " , val, " formatted to \!"", r, "\!"");
	, // strings won't be formatted
		Write("\!N\!NCol: \!"", colname, "\!" not formatted ", exception_msg);
	); 
);

Write();&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Jun 2025 06:29:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-using-quot-get-format-quot-for-making-a-PDF-from-a-data/m-p/881095#M104499</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-06-24T06:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help using "get format" for making a PDF from a data table</title>
      <link>https://community.jmp.com/t5/Discussions/Help-using-quot-get-format-quot-for-making-a-PDF-from-a-data/m-p/881274#M104525</link>
      <description>&lt;P&gt;Thanks for the help&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;
&lt;P&gt;So where I am stuck now is the formatting of the date column. Using your help I have the script to here (haven't switched over to AA's yet) and this works great except being able to format the dates:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;		dty=current data table();
		createdate=today();
		
		column_names=dty&amp;lt;&amp;lt;get column names("string");
		qty_of_rows=N Rows(dty);

		
		col_var_list={};
		var_list={};
		col_list={};
		col_format={};
		col_format_text={};
		col_width={};
		col_wrap={};
		col_for={};
		col_for2={};

// Loop through each column name
For Each({col_name}, column_names,
	col = Column(dty, col_name);
	col_for2=(col&amp;lt;&amp;lt; Get Format);
	col_for=char(col&amp;lt;&amp;lt; Get Format());

	
	insertinto(col_format,Name Expr(col_for2));
	insertinto(col_width,col&amp;lt;&amp;lt; Get Display Width);
	insertinto(col_wrap,col &amp;lt;&amp;lt; Get Display Width);

);

		for(i=1, i&amp;lt;=n items(column_names), i++,
			col_var_list[i]=column(dty,column_names[i])&amp;lt;&amp;lt; Get Values;;
		);

		nw = New Window( "PDF Print of PVNs",
			tb = Table Box()			
		);
		
		for(i=1, i&amp;lt;=n items(column_names), i++,
			tb &amp;lt;&amp;lt; append( col_list[i]=col Box(column_names[i]));
		);
		
		for(j=1, j&amp;lt;=n items(column_names), j++,
				For(i=1,i&amp;lt;= qty_of_rows, i++,
						col_list[j] &amp;lt;&amp;lt; append(Text Box(col_var_list[j][i],&amp;lt;&amp;lt;set width(col_width[j]), &amp;lt;&amp;lt; set wrap (col_wrap[j])));
						col_list[j] &amp;lt;&amp;lt; append(Text Box(col_var_list[j][i],&amp;lt;&amp;lt;set width(col_width[j]), &amp;lt;&amp;lt; set wrap (col_wrap[j])));
					);
				);
			
		tb &amp;lt;&amp;lt; Set Shade Alternate Rows( 1 );
		tb &amp;lt;&amp;lt; Set Row Borders( 1 );
		tb &amp;lt;&amp;lt; Set Row Borders( 1 );
		tb &amp;lt;&amp;lt; Set Column Borders( 1 );

		wajrn = Window( "example file" );
		wajrn &amp;lt;&amp;lt; journal;
		wajrn=Current Journal();
		wajrn &amp;lt;&amp;lt; Show Window( 0 );

		wajrn &amp;lt;&amp;lt;Set page setup(
			margins( .1, .1, .1, .1 ),
			scale( .8 ),
			portrait( 0 ),
			paper size( "Letter" ) 
		  );
		  wajrn &amp;lt;&amp;lt; Set Print Headers(""/*left*/, ""/*center*/,""/*right*/);
		  wajrn &amp;lt;&amp;lt; Set Print Footers(""/*left*/, ""/*center*/,"Updated on " || char(MDYHMS(createdate)));
		  
		//wajrn &amp;lt;&amp;lt;Save PDF("Put in file location here");
		
		wajrn&amp;lt;&amp;lt;close window;
		nw&amp;lt;&amp;lt;close window;	&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shampton82_0-1750820783277.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/77298i3CD2CDA2BA5A6011/image-size/medium?v=v2&amp;amp;px=400" role="button" title="shampton82_0-1750820783277.png" alt="shampton82_0-1750820783277.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I was using this before to format it:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;col2 &amp;lt;&amp;lt; append( Text Box(Format(coval[i],"Format Pattern", "&amp;lt;YYYY&amp;gt;&amp;lt;/&amp;gt;&amp;lt;MM&amp;gt;&amp;lt;/&amp;gt;&amp;lt;DD&amp;gt; &amp;lt;hh24&amp;gt;&amp;lt;:&amp;gt;&amp;lt;mm&amp;gt;"),&amp;lt;&amp;lt;set width(100)));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but this code does not work well with what is being pulled from the&amp;nbsp; "Get Format" function from the data table as it returns something that would use &amp;lt;&amp;lt;set format&amp;nbsp; where as I need to use format(x,formatstring,&amp;lt;options&amp;gt;) per above and I can't figure out how to get just the string part of what is returned from Get Format.&amp;nbsp; I tried this:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;col_for=char(col&amp;lt;&amp;lt; Get Format());&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and while it comes in as a string it has a bunch of \! in it like this ("Format(\!"m/d/y h:m:s\!", 27, 3)") .&amp;nbsp; Any to get rid of them?&amp;nbsp; I'm thinking so type of regex?&amp;nbsp; Once they are gone I think I can use that in the Format() function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jun 2025 03:18:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-using-quot-get-format-quot-for-making-a-PDF-from-a-data/m-p/881274#M104525</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2025-06-25T03:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help using "get format" for making a PDF from a data table</title>
      <link>https://community.jmp.com/t5/Discussions/Help-using-quot-get-format-quot-for-making-a-PDF-from-a-data/m-p/881276#M104526</link>
      <description>&lt;P&gt;I would use Expressions&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(1),
	Compress File When Saved(1),
	New Column("Column 1",
		Numeric,
		"Continuous",
		Format("Format Pattern", "&amp;lt;YYYY&amp;gt;&amp;lt;-&amp;gt;&amp;lt;MM&amp;gt;&amp;lt;-&amp;gt;&amp;lt;DD&amp;gt;&amp;lt;'T'&amp;gt;&amp;lt;hh24&amp;gt;&amp;lt;::&amp;gt;&amp;lt;mm&amp;gt;", 16),
		Input Format("m/d/y"),
		Set Selected,
		Set Values([3660681600])
	)
);

my_format = Column(dt, 1) &amp;lt;&amp;lt; Get Format;
formatted_expr = Insert(Name Expr(my_format), 3660681600, 1);
Show(formatted_expr, Eval(formatted_expr));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You should have the correct Format function which is just missing the value you wish to format -&amp;gt; use Insert to add the value as first argument inside the Format function&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;formatted_expr = Format(3660681600, "Format Pattern", "&amp;lt;YYYY&amp;gt;&amp;lt;-&amp;gt;&amp;lt;MM&amp;gt;&amp;lt;-&amp;gt;&amp;lt;DD&amp;gt;&amp;lt;'T'&amp;gt;&amp;lt;hh24&amp;gt;&amp;lt;::&amp;gt;&amp;lt;mm&amp;gt;", 16);
Eval(formatted_expr) = "2020-01-01T00:00";
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Jun 2025 04:23:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-using-quot-get-format-quot-for-making-a-PDF-from-a-data/m-p/881276#M104526</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-06-25T04:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Help using "get format" for making a PDF from a data table</title>
      <link>https://community.jmp.com/t5/Discussions/Help-using-quot-get-format-quot-for-making-a-PDF-from-a-data/m-p/881802#M104587</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;
&lt;P&gt;I got it with all your help!&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//rev 6-27-25	
pickdir="blank";
		

nw2=new window("PDF Print set up",
			Panelbox("Please set the PDF save settings",
						Lineup Box(
							hlistbox(Text Box("Margin left   "),neb1=numbereditbox(0.1)),
							hlistbox(Text Box("Margin top      "),neb2=numbereditbox(0.1)),
							hlistbox(Text Box("Margin right"),neb3=numbereditbox(0.1)),
							hlistbox(Text Box("Margin bottom"),neb4=numbereditbox(0.1)),
							hlistbox(Text Box("Scale            "),neb5=numbereditbox(0.8)),
							hlistbox(Text Box("Orientation"),cb1=combobox({"Portrait", "Landscape"})),
							hlistbox(Text Box("Paper Size"),cb2=combobox({"Letter", "Tabloid"}))
						)

					),
					hlistbox(Buttonbox("print",
												neb1_value=neb1&amp;lt;&amp;lt;get; 
												neb2_value=neb2&amp;lt;&amp;lt;get;
												neb3_value=neb3&amp;lt;&amp;lt;get; 
												neb4_value=neb4&amp;lt;&amp;lt;get; 
												neb5_value=neb5&amp;lt;&amp;lt;get;
												cb1_value=cb1&amp;lt;&amp;lt;get; if(cb1_value==1,cb1_value=1,cb1_value=0);
												cb2_value=cb2&amp;lt;&amp;lt;get; if(cb2_value==1,cb2_value="Letter",cb2_value="Tabloid");
												rb_value=rb&amp;lt;&amp;lt;get selected;
												
												///////////////////start of main script
													dt=current data table();
														createdate=today();
														dtname=dt&amp;lt;&amp;lt;getname;
														dt&amp;lt;&amp;lt;clear select();
														dt &amp;lt;&amp;lt; Clear Column Selection();
														
														col_aa={};
														column_names=dt&amp;lt;&amp;lt;get column names("string");
														column_names_numeric=dt&amp;lt;&amp;lt;get column names(Continuous,"string");
														eval(eval expr(col_aa=associative array({expr(column_names_numeric[1])},{expr(1)})));
														for(i=2, i&amp;lt;= n items(column_names_numeric), i++,
															eval(eval expr(col_aa[expr(column_names_numeric[i])]=expr(i)));
														);

														qty_of_rows=N Rows(dt);

														
														col_var_list={};
														var_list={};
														col_list={};
														col_format={};
														col_format_text={};
														col_width={};
														col_wrap={};
														col_for={};
														col_for2={};

												// Loop through each column name
												For Each({col_name}, column_names,
													col = Column(dt, col_name);
													col_for2=col&amp;lt;&amp;lt; Get Format;
													
													insertinto(col_format,Name Expr(col_for2));
													insertinto(col_width,col&amp;lt;&amp;lt; Get Display Width);
													insertinto(col_wrap,col &amp;lt;&amp;lt; Get Display Width);

												);

														for(i=1, i&amp;lt;=n items(column_names), i++,
															col_var_list[i]=column(dt,column_names[i])&amp;lt;&amp;lt; Get Values;;
														);

														try(close(wajrn,no save));
														nw = New Window( dtname||" journal",&amp;lt;&amp;lt;WindowView( "Invisible" ),
															tb = Table Box()			
														);
														
														for(i=1, i&amp;lt;=n items(column_names), i++,
															tb &amp;lt;&amp;lt; append( col_list[i]=col Box(column_names[i]));
															
														);
													
													eval(eval expr(	
														for(j=1, j&amp;lt;=n items(column_names), j++,
																For(i=1,i&amp;lt;= qty_of_rows, i++,
																		if(col_aa&amp;lt;&amp;lt;contains(column_names[j])==1,
																			formatted_expr = Insert(name Expr(col_format[j]), dt[i,j], 1);
																			col_list[j] &amp;lt;&amp;lt; append( txtb=Text Box(formatted_expr));
																			txtb&amp;lt;&amp;lt;set width(col_width[j]);
																			,
																			col_list[j] &amp;lt;&amp;lt; append(Text Box(col_var_list[j][i],&amp;lt;&amp;lt;set width(col_width[j]), &amp;lt;&amp;lt; set wrap (col_wrap[j])));
																		)
																		
																	);
																)
														));	
															
														tb &amp;lt;&amp;lt; Set Shade Alternate Rows( 1 );
														tb &amp;lt;&amp;lt; Set Row Borders( 1 );
														tb &amp;lt;&amp;lt; Set Row Borders( 1 );
														tb &amp;lt;&amp;lt; Set Column Borders( 1 );
												
												wajrn = Window( dtname||" journal" );
												wajrn &amp;lt;&amp;lt; journal;
												wajrn=Current Journal();
												wajrn &amp;lt;&amp;lt; Show Window( 0 );

												wajrn &amp;lt;&amp;lt;Set page setup(
													margins( neb1_value, neb2_value, neb3_value, neb4_value ),
													scale( neb5_value ),
													portrait( cb1_value ),
													paper size( cb2_value ) 
												  );
												  
												  wajrn &amp;lt;&amp;lt; Set Print Headers(""/*left*/, ""/*center*/,""/*right*/);
												  wajrn &amp;lt;&amp;lt; Set Print Footers(""/*left*/, ""/*center*/,"Updated on " || char(MDYHMS(createdate)));
												  
												 if (pickdir=="blank",
															pickdir=pick directory();
												 );
												wajrn &amp;lt;&amp;lt;Save PDF(pickdir||"/"||dtname||".pdf");
												if(rb_value=="Yes",
													open(pickdir||"/"||dtname||".pdf");
													);
												//close(wajrn,"Nosave");
												wajrn&amp;lt;&amp;lt;close window("Nosave");
												nw&amp;lt;&amp;lt;close window;
													
													
													
												)	,Buttonbox("cancel",nw&amp;lt;&amp;lt;close window; nw2&amp;lt;&amp;lt;close window;close(wajrn,no save);), textbox("Open PDF?"),rb = Radiobox( {"Yes", "No"}))
			);
	


		
	&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Jun 2025 20:04:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-using-quot-get-format-quot-for-making-a-PDF-from-a-data/m-p/881802#M104587</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2025-06-30T20:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Help using "get format" for making a PDF from a data table</title>
      <link>https://community.jmp.com/t5/Discussions/Help-using-quot-get-format-quot-for-making-a-PDF-from-a-data/m-p/881803#M104588</link>
      <description>&lt;P&gt;If you want to let user change all the pdf settings you can use Show Page Setup(1) with &amp;lt;&amp;lt; Save PDF&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

w = New Window("Window", Text Box("Page Setup Test"));

w &amp;lt;&amp;lt; Set page setup(
	margins(0.5, 0.5, 0.5, 0.5),
	scale(1),
	portrait(1),
	paper size("Letter")
);

w &amp;lt;&amp;lt; Save PDF("$TEMP/test.pdf", Show Page Setup(1));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But I think it might be a better idea to build your own window which would contain the path selection and the pdf settings which you want to let user control.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2025 04:59:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-using-quot-get-format-quot-for-making-a-PDF-from-a-data/m-p/881803#M104588</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-06-26T04:59:29Z</dc:date>
    </item>
  </channel>
</rss>

