I'm writing a procedure to generate reports and I'm wondering if it's possible (Is there a simple way) to insert programmatically a table in a notebook like in the attached picture.
By the way, I've done that with a copy-paste from a layout.
Thank you hrodstein, this is what I'm looking for.
But, is it possible to insert only columns with data like the first column ("jack") and not the rest of the empty table ?
But, is it possible to insert only columns with data like the first column ("jack") and not the rest of the empty table ?
You would have to resize the table window, either manually or programmatically using the MoveWindow operation, to show what you want to show.
Alternatively you can display the values of the wave as plain text:
// Example: // NewNotebook/F=1/N=TestNotebook // Make/O jack={1,2,PI,4} // Insert1DWaveInNotebook("TestNotebook", jack) Function Insert1DWaveInNotebook(nb, w) String nb // Name of notebook Wave w
Variable numPoints = numpnts(w) if(numPoints >100) Abort"Too many points in wave" endif
You would have to resize the table window, either manually or programmatically using the MoveWindow operation, to show what you want to show. You need to do this before inserting the table in the notebook. What is inserted is a picture of the table window at the time you execute the Notebook command.
Thank you hrodstein .
It works with "MoveWindow" but I have to adapt the size for each table because my tables do not necessarily have the same number of lines.
But it's a good start, I keep looking ...
Edit/N=TestTable jack
NewNotebook/F=1/N=TestNotebook
Notebook TestNotebook, picture={TestTable, 0, 1}
November 14, 2016 at 12:59 pm - Permalink
But, is it possible to insert only columns with data like the first column ("jack") and not the rest of the empty table ?
November 14, 2016 at 11:53 pm - Permalink
You would have to resize the table window, either manually or programmatically using the MoveWindow operation, to show what you want to show.
Alternatively you can display the values of the wave as plain text:
// NewNotebook/F=1/N=TestNotebook
// Make/O jack={1,2,PI,4}
// Insert1DWaveInNotebook("TestNotebook", jack)
Function Insert1DWaveInNotebook(nb, w)
String nb // Name of notebook
Wave w
Variable numPoints = numpnts(w)
if (numPoints > 100)
Abort "Too many points in wave"
endif
Variable i
for(i=0; i<numPoints; i+=1)
String valueText
sprintf valueText, "%g\r", w[i]
Notebook $nb, text=valueText
endfor
End
November 15, 2016 at 02:52 am - Permalink
what I'm looking for is explained in the attached image...
November 15, 2016 at 03:31 am - Permalink
November 15, 2016 at 05:00 am - Permalink
It works with "MoveWindow" but I have to adapt the size for each table because my tables do not necessarily have the same number of lines.
But it's a good start, I keep looking ...
November 16, 2016 at 12:41 am - Permalink