Thread

Posted on Mon Oct 29 19:28:58 2007 by ag888
Cell style definition
Pelase help in the investigation of behaviour of the fragment:
use OpenOffice::OODoc; my $doc = ooDocument(file => 'tttsty.odt', create => 'spreadsheet'); my $sheet = $doc->getTable(0, 5, 5); $sty = $doc->createStyle("RRR", parent => 'Default', properties => {'fo:text-align' => 'Right'}); $doc->cellValue($sheet,0,0,"aaa"); $doc->cellStyle($sheet,0,0,"RRR"); $doc->save;
RRR style is not have been saved to the document. What wrong in this script? OODoc version = 2.035
Direct Responses: 6369 | Write a response
Posted on Tue Oct 30 22:38:46 2007 by ag888 in response to 6361
Re: Cell style definition
I think that a know what this query have as answer the silence only... It turned out, that formatting in ODF spreadsheets - extremely difficult task. And even OODoc cannot be able to do this easily. Problem gone mutate: The question: How to create a syntethic (with cell, paragraph and text properties) style like that?:
<style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default"> <style:table-cell-properties style:text-align-source="fix" style:repeat-content="false" /> <style:paragraph-properties fo:text-align="end" /> <style:text-properties fo:color="#ff3366" /> </style:style>
The second question: How to order style to be as default cell-style for column?:
<table:table-column table:style-name="co1" table:default-cell-style-name="ce1" />
OODoc pods dont clear these aspects.
Direct Responses: 6371 | Write a response
Posted on Wed Oct 31 09:02:45 2007 by ag888 in response to 6369
Re: Cell style definition
Here the final of my investigation:
... $sty = $doc->createStyle("RRR", family => 'paragraph', parent => 'Standart', properties => { 'fo:text-align' => 'end', 'fo:color' => '#ff0000' } ); $doc->cellValue($sheet,1,1,"aaa"); #$doc->columnStyle($sheet,1,"Noname1"); # dont works (because Noname1 is the <table-cell +> style but not <table-column>) $doc->cellStyle($sheet,1,1,"Noname1"); # works only ! Noname1 - the style created by hands and +especially placed to OODoc templates #$doc->textStyle($doc->getCellParagraph($sheet,1,1), "Heading"); # cannot use <table-cell> styles ! +? - the ODF lack ? #$doc->setStyle($doc->getCell($sheet,1,1), "Noname1"); # it is acceptable combination of calls ? ...
It seems OpenOffice::OODoc dont leave (in present state?) sufficient facilities to full control of OO documents layout!? May be UNO make grant such things (i.e. full control)? But UNO at now is not fully-usable intended pure Open-Source style (OpenOffice-UNO have to build only with MS development tools)...
Direct Responses: 6372 | Write a response
Posted on Wed Oct 31 09:12:14 2007 by ag888 in response to 6371
Re: Cell style definition
...automatic styles (defined like above "RRR") also cannot be used to cell text formatting because it is impossible to define valuable table-cell style from perl-scipt.
Write a response