[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [forge: IO] Column spacing in created ODS spreadsheets
From: |
PhilipNienhuis |
Subject: |
Re: [forge: IO] Column spacing in created ODS spreadsheets |
Date: |
Tue, 24 Dec 2013 12:58:19 -0800 (PST) |
Nir Krakauer-2 wrote
> With a script like the following:
>
> chk = chk_spreadsheet_support();
>
> file_out = 'demo.ods';
>
> if exist(file_out, "file")
> system(['rm ' file_out]); #deletes spreadsheet if already exists
> endif
>
> ods = odsopen(file_out, true);
>
> n_sheets = 3;
>
> for sheet = 1:n_sheets
>
> sheet_name = num2str(sheet);
>
> [ods, status] = oct2ods ({'Hello'}, ods, sheet_name, 'A1');
> [ods, status] = oct2ods (sheet, ods, sheet_name, 'B1');
>
> endfor
>
> ods = odsclose(ods);
>
>
> The output file has 3 sheets, as expected. Sheet 1 has typical column
> widths (0.89 inches), while sheets 2 and above have very wide columns A
> and
> B (6 inches). Is there any way to keep the column widths at reasonable
> values?
AFAIK this is only a problem with the "OTK" (ODF Toolkit) interface.
Try another interface for ods, like jOpenDocument ("JOD") or tru LibreOffice
("UNO").
For jOpenDocument, just add ', "jod" to the odsopen call:
ods = odsopen(file_out, true, "jod");
FYI: ODF Toolkit has more problems than just this.
As to this issue I thought of including some Java methods to globally set
column width, but this is less straightforward than I hoped. In addition ODF
Toolkit isn't quite stable.
Another thing is that the spreadsheet I/O functions are only meant for data
interchange, not cell formatting. The latter would imply significantly more
complex code.
Philip
--
View this message in context:
http://octave.1599824.n4.nabble.com/forge-IO-Column-spacing-in-created-ODS-spreadsheets-tp4660357p4660361.html
Sent from the Octave - General mailing list archive at Nabble.com.