hi christian,
On Friday 18 March 2005 17:06, Cristian Fonti wrote:
I try to set the properties also after that before, but nothing...
I have another problems: i want to change the column width values, and i
suppose that he only way to change them is use TextColumnSeparator.
But,the value that you must insert, what is? is a formula of what?? is
the distance from left margin or is the real width of the column??
Thanks to all
TableColumnSeparators wants relative positions of separators.
the positions are relative to the sum in "TableColumnRelativeSum" property (default is 10000, afaik).
assuming you know the absolute table width (in mm) - in my case it just equals to page width -
you can convert these to absolute (mm) values.
this is what i do in c++, sorry i've got no java code:
m_widths is an array, that contains the desired width of each column in mm. pageWidth, marginLeft and
marginRight in my example come from the PageStyle.
Any rs = xTableProps->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("TableColumnRelativeSum")));
short relativeSum;
rs >> relativeSum;
Any separators;
separators=xTableProps->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("TableColumnSeparators")));
Sequence<TableColumnSeparator> tcs;
separators >>= tcs;
long sum=0;
double mm2rel=((double)relativeSum / (double)(pageWidth-marginLeft-marginRight))*100.0;
for(long i=0; i < tcs.getLength() && i < (long)m_widths.count(); i++)
{
tcs[i].Position = (short)(((m_widths[i]*mm2rel))+sum);
sum=tcs[i].Position;
}
xTableProps->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("TableColumnSeparators")),makeAny(tcs));
i don't know if this is "the right way", but it works nicely for me
regards,
- till
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Thanks to all,