07-06-2021 05:49 PM
We wish to change the numeric format of values in the report, but want to embed that in the specific sequence file, not make it global for the station. Is there a call that will set it for the current report? When would be the right time to call it, during PreUUT?
07-07-2021 09:15 AM
So the first thing you need to understand is that a numeric in TestStand is more than just a number. It carries the attributes which tell it how to be formatted. So at every step that is logging, each number that gets logged could potentially have a different format defined.
Here's my recommendation:
Leave every numeric as default. Then override the ReportOptions callback. Set the Parameters.ReportOptions.NumericFormat property in a statement step to something like: Parameters.ReportOptions.NumericFormat = "%g". Then any number that has a "default" setting as the format will be reformatted to the defined report options default format.
Hopefully this makes sense. Let me know if you have any questions about this.
08-28-2025 09:52 AM - edited 08-28-2025 09:56 AM
Hey there, I know this is an old thread.
For anyone else trying to figure out where where the numeric formatting comes from in NI's report plugin (NI_ReportGenerator.seq):
Every PropertyObject (e.g. a local or global) has a NumericFormat property. Only numeric PropertyObjects actually use it, though.
NumericFormat is a C style format string. (e.g. %.3f). The NumericFormat property is set from the sequence editor by right-clicking on the variable and selecting "Numeric Format".
If NumericFormat is set for a variable (PropertyObject), the report generator plugin uses this to format the numeric string in the report, regardless of the report type. (ATML, HTML, etc.)
For all other cases, the numeric strings in the report are formatted according to the "Default Numeric Format" configured in the Report Options dialog.
As @~jiggawax~ mentioned, this is ReportOptions.NumericFormat in the ReportOptions.
If you're seeing formatting inconsistent with what's set in Report Options, look for the NumericFormat property being set on variables.
Thus the approach mentioned above by @~jiggawax~ is definitely the best way to go about it. Avoid using the NumericFormat property on variables. It's not at all obvious when it's set and is a real headache to track down.
It's also worth mentioning that NI's database plugin ignores NumericFormat. In the default schemas shipped with TestStand, the PROP_RESULT table has a DATA column that is populated with measurement values, among others. Numeric values are represented as strings here, since the column itself is a string. The format of numeric values in the DATA column has nothing to do with the NumericFormat property of a variable. However, the plugin does populate the DISPLAY_FORMAT column with the C format string contained in the NumericFormat property, if set.
This information is not well documented and took me hours to figure out. Hopefully this post will save someone a lot of trouble in the future.
Mr. Jim