On 02/23/10 03:38, John W wrote:
I'm writing out .ODS files via a program.
I'd like to find a way to adjust all the column widths such that no
cells "spill over" when the file is opened in Calc.
That is: for each column, I want the column width to be that of the
widest cell in that column.

This doesn't really belong into the "dba" lists, but anyway...

I'm not using UNO since that requires at least URE to be installed on
the machine generating the files. But if someone has a solid way of
getting this to work with UNO, I'd be interested to hear, regardless.

Using the API, you can set the column's property "OptimalWidth" to true. This doesn't really set a property, but applies the optimal width instead.

(2)
Calculate the width manually and hardcode it into the
style:column-width attribute.
This might work - I'm still working on it.

But that still leaves the issue of knowing what font will be used by default.
Calc seems to use Arial 10 point, but is that guaranteed?

If you create the file, you can specify the font (in the default-style element).

Niklas

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@dba.openoffice.org
For additional commands, e-mail: dev-h...@dba.openoffice.org

Reply via email to