2016-03-08

‎Incompatible changes: Pagelayout being a class now

← Older revision

Revision as of 17:17, 8 March 2016

(6 intermediate revisions by the same user not shown)

Line 1,303:

Line 1,303:

=== Page layout ===

=== Page layout ===

+

==== General ====

So far, FPSpreadsheet does not support printing of worksheets, but the Office applications do, and they provide a section of information in their files for this purpose. In FPSpreadsheets this information is available in the <tt>TsPageLayout</tt> class which belongs to the <tt>TsWorksheet</tt> data structure. Its properties and methods combine the most important features from the Excel and OpenDocument worlds.

So far, FPSpreadsheet does not support printing of worksheets, but the Office applications do, and they provide a section of information in their files for this purpose. In FPSpreadsheets this information is available in the <tt>TsPageLayout</tt> class which belongs to the <tt>TsWorksheet</tt> data structure. Its properties and methods combine the most important features from the Excel and OpenDocument worlds.

<syntaxhighlight>

<syntaxhighlight>

Line 1,316:

Line 1,317:

TsHeaderFooterSectionIndex = (hfsLeft, hfsCenter, hfsRight);

TsHeaderFooterSectionIndex = (hfsLeft, hfsCenter, hfsRight);

+

+

TsCellRange = record

+

Row1, Col1, Row2, Col2: Cardinal;

+

end;

TsPageLayout = class

TsPageLayout = class

Line 1,375:

Line 1,380:

end;

end;

</syntaxhighlight>

</syntaxhighlight>

+

+

{{Note|The fact that the <tt>PageLayout</tt> belongs to the worksheet indicates that there can be several page layouts in the same workbook, one for each worksheet. }}

* '''Orientation''' defines the orientation of the printed paper, either portrait or landscape.

* '''Orientation''' defines the orientation of the printed paper, either portrait or landscape.

Line 1,403:

Line 1,410:

* The '''Options''' define further printing properties, their names are self-explaining. They were defined according to Excel files, some of them do not exist in ODS files and are ignored there.

* The '''Options''' define further printing properties, their names are self-explaining. They were defined according to Excel files, some of them do not exist in ODS files and are ignored there.



+

==== Headers and footers ====

'''Header and footer texts''' can be composed of left-aligned, centered and right-aligned strings. Add the symbol <tt>&L</tt> to indicate that the following string is to be printed as the left-aligned part; use <tt>&C</tt> accordingly for the centered and <tt>&R</tt> for the right-aligned parts. There are other symbols which will be replaced by their counterparts during printing:

'''Header and footer texts''' can be composed of left-aligned, centered and right-aligned strings. Add the symbol <tt>&L</tt> to indicate that the following string is to be printed as the left-aligned part; use <tt>&C</tt> accordingly for the centered and <tt>&R</tt> for the right-aligned parts. There are other symbols which will be replaced by their counterparts during printing:

* <tt>&L</tt>: begins the '''left-aligned section''' of a header or a footer text definition

* <tt>&L</tt>: begins the '''left-aligned section''' of a header or a footer text definition

Line 1,429:

Line 1,436:

* <tt>&Krrggbb</tt>: switch to the '''font color''' specified to the binary value of the specified color, e.g. use <tt>&KFF0000</tt> for red.

* <tt>&Krrggbb</tt>: switch to the '''font color''' specified to the binary value of the specified color, e.g. use <tt>&KFF0000</tt> for red.



The arrays <tt>Headers[]</tt>/<tt>Footers[]</tt> provide space for usage of three different headers or footers:

+

The arrays <tt>Headers[]</tt>/<tt>Footers[]</tt> provide space for usage of three different headers or footers:

* <tt>Headers[0]</tt> refers to the header used on the '''first page''' only, similarly for <tt>Footers[0]</tt>. Instead of index <tt>0</tt> you can use the constant <tt>HEADER_FOOTER_INDEX_FIRST</tt>. Leave this string empty if there is no special first-page header/footer.

* <tt>Headers[0]</tt> refers to the header used on the '''first page''' only, similarly for <tt>Footers[0]</tt>. Instead of index <tt>0</tt> you can use the constant <tt>HEADER_FOOTER_INDEX_FIRST</tt>. Leave this string empty if there is no special first-page header/footer.

* <tt>Headers[1]</tt> refers to the header on pages with '''odd page numbers''', similarly for <tt>Footers[1]</tt>. Instead of index <tt>1</tt> you may want to use the constant <tt>HEADER_FOOTER_INDEX_ODD</tt>.

* <tt>Headers[1]</tt> refers to the header on pages with '''odd page numbers''', similarly for <tt>Footers[1]</tt>. Instead of index <tt>1</tt> you may want to use the constant <tt>HEADER_FOOTER_INDEX_ODD</tt>.

Line 1,439:

Line 1,446:

MyWorksheet.PageLayout.Footers[HEADER_FOOTER_INDEX_EVEN] := '&LPage &P of &N';  // dto, but left-aligned on even pages

MyWorksheet.PageLayout.Footers[HEADER_FOOTER_INDEX_EVEN] := '&LPage &P of &N';  // dto, but left-aligned on even pages

</syntaxhighlight>

</syntaxhighlight>





{{Note|The fact that the <tt>PageLayout</tt> belongs to the worksheet indicates that there can be several page layouts in the same workbook, one for each worksheet. }}

=== Loading and saving ===

=== Loading and saving ===

Line 1,987:

Line 1,992:

* Ability to write to/read from the system's '''clipboard''' for copy & paste using the visual controls.

* Ability to write to/read from the system's '''clipboard''' for copy & paste using the visual controls.

* Support for '''print ranges''' and '''repeated header rows and columns''' in the Office applications.

* Support for '''print ranges''' and '''repeated header rows and columns''' in the Office applications.

+

* Support for '''embedded images''' (currently only writing to xlsx).

* Improved compatibility of '''TsWorksheetGrid''' with TStringGrid (<tt>Cells[Col,Row]</tt> property). Standalone application as an advanced StringGrid replacement.

* Improved compatibility of '''TsWorksheetGrid''' with TStringGrid (<tt>Cells[Col,Row]</tt> property). Standalone application as an advanced StringGrid replacement.

* Support for '''Right-to-left mode''' in TsWorksheetGrid. In addition to the system-wide RTL mode, there are also parameters <tt>BiDiMode</tt> in the Worksheet and cells allowing to controls text direction at worksheet and cell level individually, like in Excel or LibreOffice Calc.

* Support for '''Right-to-left mode''' in TsWorksheetGrid. In addition to the system-wide RTL mode, there are also parameters <tt>BiDiMode</tt> in the Worksheet and cells allowing to controls text direction at worksheet and cell level individually, like in Excel or LibreOffice Calc.

Line 1,993:

Line 1,999:

* The worksheet methods <tt>ReadAsUTF8Text</tt> and <tt>WriteUTF8Text</tt> have been renamed to <tt>ReadAsText</tt> and <tt>WriteText</tt>, respectively. The old ones are still available and marked as deprecated; they will be removed in later versions.

* The worksheet methods <tt>ReadAsUTF8Text</tt> and <tt>WriteUTF8Text</tt> have been renamed to <tt>ReadAsText</tt> and <tt>WriteText</tt>, respectively. The old ones are still available and marked as deprecated; they will be removed in later versions.

* The public properties of <tt>TsWorksheetGrid</tt> using a <tt>TRect</tt> as parameter were modified to use the Left, Top, Right, Bottom values separately.

* The public properties of <tt>TsWorksheetGrid</tt> using a <tt>TRect</tt> as parameter were modified to use the Left, Top, Right, Bottom values separately.

+

* The <tt>PageLayout</tt> is a class now, no longer a record. As a consequence, some array properties cannot be set directly any more, use the corresponding methods instead.

==== To do list ====

==== To do list ====

Line 2,107:

Line 2,114:

{| class="wikitable"

{| class="wikitable"



! Format || Multiple sheets || Unicode || Reader support || Writer support || Text || Number || String Formula || RPN Formula || Date/Time || Comments || Hyperlinks

+

! Format || Multiple sheets || Unicode || Reader support || Writer support || Text || Number || String Formula || RPN Formula || Date/Time || Comments || Hyperlinks
|| Images

|----

|----



|CSV files || align="center"|No || align="center"|Yes + || class="working"|Working ++ || class="working"|Working ++|| class="working"|Working ++|| class="working"|Working ++|| align="center"|N/A || align="center"|N/A || class="working"|Working ++ || align="center"|N/A || align="center"|N/A

+

|CSV files || align="center"|No || align="center"|Yes + || class="working"|Working ++ || class="working"|Working ++|| class="working"|Working ++|| class="working"|Working ++|| align="center"|N/A || align="center"|N/A || class="working"|Working ++
|| align="center"|N/A
|| align="center"|N/A || align="center"|N/A

|-

|-



|Excel 2.x || align="center"|No|| align="center"|No * || class="working"|Working ** || class="working"|Working || class="working"|Working || class="working"|Working || class="working"|Working || class="working"|Working ***|| class="working"|Working **** || class="working"|Working || align="center"|N/A

+

|Excel 2.x || align="center"|No|| align="center"|No * || class="working"|Working ** || class="working"|Working || class="working"|Working || class="working"|Working || class="working"|Working || class="working"|Working ***|| class="working"|Working **** || class="working"|Working
|| align="center"|N/A
|| align="center"|N/A

|----

|----



|Excel 5.0 (Excel 5.0 and 95) || align="center"|Yes || align="center"|No * || class="working"|Working ** || class="working"|Working || class="working"|Working || class="working"|Working || class="working"|Working || class="working"|Working ***|| class="working"|Working **** || class="working"|Working || align="center"|N/A

+

|Excel 5.0 (Excel 5.0 and 95) || align="center"|Yes || align="center"|No * || class="working"|Working ** || class="working"|Working || class="working"|Working || class="working"|Working || class="working"|Working || class="working"|Working ***|| class="working"|Working **** || class="working"|Working
|| align="center"|N/A
|| align="center"|N/A

|----

|----



|Excel 8.0 (Excel 97- 2003) || align="center"|Yes || align="center"|Yes || class="working"|Working ** || class="working"|Working || class="working"|Working || class="working"|Working || class="working"|Working || class="working"|Working ***|| class="working"|Working **** || class="partial"| Reading only || class="working"|Working

+

|Excel 8.0 (Excel 97- 2003) || align="center"|Yes || align="center"|Yes || class="working"|Working ** || class="working"|Working || class="working"|Working || class="working"|Working || class="working"|Working || class="working"|Working ***|| class="working"|Working **** || class="partial"| Reading only || class="working"|Working
|| class="not working"|Not working

|----

|----



|Microsoft OOXML || align="center"|Yes || align="center"|Yes || class="working"|Working ** || class="working"|Working || class="working"|Working || class="working"|Working || class="working"|Working *** || class="working"|Working || class="working"|Working **** || class="working"|Working || class="working"|Working

+

|Microsoft OOXML || align="center"|Yes || align="center"|Yes || class="working"|Working ** || class="working"|Working || class="working"|Working || class="working"|Working || class="working"|Working *** || class="working"|Working || class="working"|Working **** || class="working"|Working || class="working"|Working
|| class="partial"|Writing only

|----

|----



|OpenDocument || align="center"|Yes || align="center"|Yes || class="working"|Working ** || class="working"|Working || class="working"|Working || class="working"|Working || class="working"|Working *** || class="working"|Working || class="working"|Working **** || class="working"|Working || class="working"|Working

+

|OpenDocument || align="center"|Yes || align="center"|Yes || class="working"|Working ** || class="working"|Working || class="working"|Working || class="working"|Working || class="working"|Working *** || class="working"|Working || class="working"|Working **** || class="working"|Working || class="working"|Working
|| class="not working"|Not working

|-

|-



|HTML || align="center"|No || align="center"|Yes || class="wprking"|Working ++ || class="working"|Working ++|| class="working"|Working ++|| class="working"|Working ++|| align="center"|N/A || align="center"|N/A || class="working"|Working ++ || align="center"|N/A || class="working"|Working

+

|HTML || align="center"|No || align="center"|Yes || class="wprking"|Working ++ || class="working"|Working ++|| class="working"|Working ++|| class="working"|Working ++|| align="center"|N/A || align="center"|N/A || class="working"|Working ++ || align="center"|N/A || class="working"|Working
|| class="not working"|Not working

|-

|-



|Wikitable files (Mediawiki)|| align="center"|No || align="center"|Yes || align="center"|planned || class="working"|Working ++|| class="working"|Working ++|| class="working"|Working ++|| align="center"|N/A || align="center"|N/A || class="working"|Working ++ || align="center"|N/A || align="center"|N/A

+

|Wikitable files (Mediawiki)|| align="center"|No || align="center"|Yes || align="center"|planned || class="working"|Working ++|| class="working"|Working ++|| class="working"|Working ++|| align="center"|N/A || align="center"|N/A || class="working"|Working ++ || align="center"|N/A || align="center"|N/A
|| class="not working"|Not working

|}

|}

Show more