Showing results for 
Search instead for 
Did you mean: 

Tabular Note default preferences

Valued Contributor
Valued Contributor



I am calling UF_TABNOT_set_cell_text to write to a Tabular Note some text strings containing representations of floating-point numbers.  When I call "UF_TABNOT_set_default_cell_prefs" before I add all the rows to the Tabular Note, it doesn't seem to take -- although I pass in a UF_TABNOT_cell_prefs_t with the precision field set to 2, the values are instead formatted with a precision of 4 or something like that.  If I instead call the following before each cell write:


UF_TABNOT_ask_cell_prefs(cell, &prefs);
prefs.format = UF_TABNOT_format_fixed;
prefs.precision = 2;
UF_TABNOT_set_cell_prefs(cell, &prefs);

the values are then displayed with precision 2.


Am I misunderstanding what UF_TABNOT_set_default_cell_prefs is supposed to do, or is it not working?


Re: Tabular Note default preferences

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

After you use "UF_TABNOT_set_default_cell_prefs", are you creating a new note and adding information, or adding information to an existing tabular note?


I think "UF_TABNOT_set_default_cell_prefs" will set the preferences for the next note(s) that are created. If you are working with an existing tabular note, you will have to change the existing cell preferences.

Re: Tabular Note default preferences

Valued Contributor
Valued Contributor
I am now no longer sure whether I saw what I saw. I was working with a tabnot that had been created from a template using UF_TABNOT_create_from_template , and I later discovered that the code I was editing reused some rows already existing in the template, before adding more. I'm pretty sure that, like you said, even the added rows didn't respect default cell prefs, but I'm not completely sure. Now that I've rewritten it to set the defaults before creating the tabnot, and also to destroy those pre-existing rows, I can't justify taking the time to go back and experiment and figure out which of those two changes fixed it -- but if my memory is correct, you were right. Thanks.