Hi,
Please run the below script:
void apply_cell_format(int nRowIndexOfLongNameLabel = -4)
{
Worksheet wks = Project.ActiveLayer();
if( !wks )
{
printf("Please keep worksheet active before running.\n");
return;
}
Tree tr;
tr.Root.RangeStyles.RangeStyle1.Style.Font.Bold.nVal = 1;
tr.Root.RangeStyles.RangeStyle1.Left.nVal = 1;
tr.Root.RangeStyles.RangeStyle1.Top.nVal = 1;
tr.Root.RangeStyles.RangeStyle1.Right.nVal = 1;
tr.Root.RangeStyles.RangeStyle1.Bottom.nVal = 1;
tr.Root.CommonStyle.Font.Bold.nVal = 1;
DataRange dr;
int c1 = 0, c2 = 1;
dr.Add( "Range1", wks, nRowIndexOfLongNameLabel, c1, nRowIndexOfLongNameLabel, c2);
// apply the format
if( 0 == dr.UpdateThemeIDs(tr.Root) )
{
bool bRet = dr.ApplyFormat( tr, true, true );
}
}
In this script, the index of first row of data is 0, you can count upward, then the index of long name is -4, see the screenshot, so I set nRowIndexOfLongNameLabel = -4 in the first line.
You can find more example here, http://www.originlab.com/doc/OriginC/examples/Formatting
Originlab Technical Service Team