<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.harlamenkov.ru/index.php?action=history&amp;feed=atom&amp;title=EN%2Fdocumentation%2Fbasic_guide%2Fformatting_spreadsheet_documents</id>
	<title>EN/documentation/basic guide/formatting spreadsheet documents - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.harlamenkov.ru/index.php?action=history&amp;feed=atom&amp;title=EN%2Fdocumentation%2Fbasic_guide%2Fformatting_spreadsheet_documents"/>
	<link rel="alternate" type="text/html" href="https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/formatting_spreadsheet_documents&amp;action=history"/>
	<updated>2026-11-11T13:51:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/formatting_spreadsheet_documents&amp;diff=15959&amp;oldid=prev</id>
		<title>Sancho: Основной текст</title>
		<link rel="alternate" type="text/html" href="https://wiki.harlamenkov.ru/index.php?title=EN/documentation/basic_guide/formatting_spreadsheet_documents&amp;diff=15959&amp;oldid=prev"/>
		<updated>2011-09-02T18:15:16Z</updated>

		<summary type="html">&lt;p&gt;Основной текст&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;section begin=title /&amp;gt;&amp;lt;noinclude&amp;gt;{{DISPLAYTITLE:&amp;lt;/noinclude&amp;gt;Formatting Spreadsheet Documents&amp;lt;noinclude&amp;gt;}}&amp;lt;/noinclude&amp;gt;&amp;lt;section end=title /&amp;gt;{{BreadCrumbL10n}}&lt;br /&gt;
&lt;br /&gt;
{{Documentation/BASICGuideTOC&lt;br /&gt;
|ShowPrevNext=block&lt;br /&gt;
|ShowPrevPage=block&lt;br /&gt;
|PrevPage=EN/documentation/basic_guide/cells_and_ranges&lt;br /&gt;
|NextPage=EN/documentation/basic_guide/editing_spreadsheet_documents&lt;br /&gt;
|spread=block&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
A spreadsheet document provides properties and methods for formatting cells and pages.&lt;br /&gt;
&lt;br /&gt;
== Cell Properties ==&lt;br /&gt;
&lt;br /&gt;
There are numerous options for formatting cells, such as specifying the font type and size for text. Each cell supports the &amp;lt;idl&amp;gt;com.sun.star.style.CharacterProperties&amp;lt;/idl&amp;gt; and &amp;lt;idl&amp;gt;com.sun.star.style.ParagraphProperties&amp;lt;/idl&amp;gt; services, the main properties of which are described in [[Documentation/BASIC Guide/Text Documents|Text Documents]]. Special cell formatting is handled by the &amp;lt;idl&amp;gt;com.sun.star.table.CellProperties&amp;lt;/idl&amp;gt; service. The main properties of this service are described in the following sections.&lt;br /&gt;
&lt;br /&gt;
You can apply all of the named properties to individual cells and to cell ranges.&lt;br /&gt;
&lt;br /&gt;
{{VBAnote|The &amp;lt;tt&amp;gt;CellProperties&amp;lt;/tt&amp;gt; object in the {{OOo}} API is comparable with the &amp;lt;tt&amp;gt;Interior&amp;lt;/tt&amp;gt; object from VBA which also defines cell-specific properties.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Background Color and Shadows ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;idl&amp;gt;com.sun.star.table.CellProperties&amp;lt;/idl&amp;gt; service provides the following properties for defining background colors and shadows:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;CellBackColor (Long)&amp;lt;/tt&amp;gt;:background color of the table cell&lt;br /&gt;
;&amp;lt;tt&amp;gt;IsCellBackgroundTransparent (Boolean)&amp;lt;/tt&amp;gt;:sets the background color to transparent&lt;br /&gt;
;&amp;lt;tt&amp;gt;ShadowFormat (struct)&amp;lt;/tt&amp;gt;:specifies the shadow for cells (structure in accordance with &amp;lt;idl&amp;gt;com.sun.star.table.ShadowFormat&amp;lt;/idl&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;idl&amp;gt;com.sun.star.table.ShadowFormat&amp;lt;/idl&amp;gt; structure and the detailed specifications for cell shadows have the following structure:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;Location (enum)&amp;lt;/tt&amp;gt;:position of shadow (value from the &amp;lt;idl&amp;gt;com.sun.star.table.ShadowLocation&amp;lt;/idl&amp;gt; structure).&lt;br /&gt;
;&amp;lt;tt&amp;gt;ShadowWidth (Short)&amp;lt;/tt&amp;gt;:size of shadow in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;IsTransparent (Boolean)&amp;lt;/tt&amp;gt;:sets the shadow to transparent&lt;br /&gt;
;&amp;lt;tt&amp;gt;Color (Long)&amp;lt;/tt&amp;gt;:color of shadow&lt;br /&gt;
&lt;br /&gt;
The following example writes the number 1000 to the B2 cell, changes the background color to red using the &amp;lt;tt&amp;gt;CellBackColor&amp;lt;/tt&amp;gt; property, and then creates a light gray shadow for the cell that is moved 1 mm to the left and down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim Doc As Object&lt;br /&gt;
Dim Sheet As Object&lt;br /&gt;
Dim Cell As Object&lt;br /&gt;
Dim ShadowFormat As New com.sun.star.table.ShadowFormat&lt;br /&gt;
&lt;br /&gt;
Doc = ThisComponent&lt;br /&gt;
Sheet = Doc.Sheets(0)&lt;br /&gt;
Cell = Sheet.getCellByPosition(1,1)&lt;br /&gt;
&lt;br /&gt;
Cell.Value = 1000&lt;br /&gt;
&lt;br /&gt;
Cell.CellBackColor = RGB(255, 0, 0)&lt;br /&gt;
&lt;br /&gt;
ShadowFormat.Location = com.sun.star.table.ShadowLocation.BOTTOM_RIGHT&lt;br /&gt;
ShadowFormat.ShadowWidth = 100&lt;br /&gt;
ShadowFormat.Color = RGB(160, 160, 160)&lt;br /&gt;
&lt;br /&gt;
Cell.ShadowFormat = ShadowFormat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Justification ==&lt;br /&gt;
&lt;br /&gt;
{{OOo}} provides various functions that allow you to change the justification of a text in a table cell.&lt;br /&gt;
&lt;br /&gt;
The following properties define the horizontal and vertical justification of a text: &lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;HoriJustify (enum)&amp;lt;/tt&amp;gt;:horizontal justification of the text (value from &amp;lt;idl&amp;gt;com.sun.star.table.CellHoriJustify&amp;lt;/idl&amp;gt;)&lt;br /&gt;
;&amp;lt;tt&amp;gt;VertJustify (enum)&amp;lt;/tt&amp;gt;:vertical justification of the text (value from &amp;lt;idl&amp;gt;com.sun.star.table.CellVertJustify&amp;lt;/idl&amp;gt;)&lt;br /&gt;
;&amp;lt;tt&amp;gt;Orientation (enum)&amp;lt;/tt&amp;gt;:orientation of text (value in accordance with &amp;lt;idl&amp;gt;com.sun.star.table.CellOrientation&amp;lt;/idl&amp;gt;)&lt;br /&gt;
;&amp;lt;tt&amp;gt;IsTextWrapped (Boolean)&amp;lt;/tt&amp;gt;:permits automatic line breaks within the cell&lt;br /&gt;
;&amp;lt;tt&amp;gt;RotateAngle (Long)&amp;lt;/tt&amp;gt;:angle of rotation of text in hundredths of a degree&lt;br /&gt;
&lt;br /&gt;
The following example shows how you can &amp;quot;stack&amp;quot; the contents of a cell so that the individual characters are printed one under another in the top left corner of the cell. The characters are not rotated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim Doc As Object&lt;br /&gt;
Dim Sheet As Object&lt;br /&gt;
Dim Cell As Object&lt;br /&gt;
&lt;br /&gt;
Doc = ThisComponent&lt;br /&gt;
Sheet = Doc.Sheets(0)&lt;br /&gt;
Cell = Sheet.getCellByPosition(1,1)&lt;br /&gt;
&lt;br /&gt;
Cell.Value = 1000&lt;br /&gt;
&lt;br /&gt;
Cell.HoriJustify = com.sun.star.table.CellHoriJustify.LEFT&lt;br /&gt;
Cell.VertJustify = com.sun.star.table.CellVertJustify.TOP&lt;br /&gt;
Cell.Orientation = com.sun.star.table.CellOrientation.STACKED&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Number, Date and Text Format ==&lt;br /&gt;
&lt;br /&gt;
{{OOo}} provides a whole range of predefined date and time formats. Each of these formats has an internal number that is used to assign the format to cells using the &amp;lt;tt&amp;gt;NumberFormat&amp;lt;/tt&amp;gt; property. {{OOo}} provides the &amp;lt;tt&amp;gt;queryKey&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;addNew&amp;lt;/tt&amp;gt; methods so that you can access existing number formats as well as create your own number formats. The methods are accessed through the following object call:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
NumberFormats = Doc.NumberFormats&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A format is specified using a format string that is structured in a similar way to the format function of {{OOo}} Basic. However there is one major difference: whereas the command format expects English abbreviations and decimal points or characters as thousands separators, the country-specified abbreviations must be used for the structure of a command format for the &amp;lt;tt&amp;gt;NumberFormats&amp;lt;/tt&amp;gt; object.&lt;br /&gt;
&lt;br /&gt;
The following example formats the B2 cell so that numbers are displayed with three decimal places and use commas as a thousands separator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim Doc As Object&lt;br /&gt;
Dim Sheet As Object&lt;br /&gt;
Dim Cell As Object&lt;br /&gt;
Dim NumberFormats As Object&lt;br /&gt;
Dim NumberFormatString As String&lt;br /&gt;
Dim NumberFormatId As Long&lt;br /&gt;
Dim LocalSettings As New com.sun.star.lang.Locale&lt;br /&gt;
&lt;br /&gt;
Doc = ThisComponent&lt;br /&gt;
Sheet = Doc.Sheets(0)&lt;br /&gt;
Cell = Sheet.getCellByPosition(1,1)&lt;br /&gt;
&lt;br /&gt;
Cell.Value = 23400.3523565&lt;br /&gt;
&lt;br /&gt;
LocalSettings.Language = &amp;quot;en&amp;quot;&lt;br /&gt;
LocalSettings.Country = &amp;quot;us&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NumberFormats = Doc.NumberFormats&lt;br /&gt;
NumberFormatString = &amp;quot;#,##0.000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
NumberFormatId = NumberFormats.queryKey(NumberFormatString, LocalSettings, True)&lt;br /&gt;
If NumberFormatId = -1 Then&lt;br /&gt;
   NumberFormatId = NumberFormats.addNew(NumberFormatString, LocalSettings)&lt;br /&gt;
End If&lt;br /&gt;
&lt;br /&gt;
MsgBox NumberFormatId&lt;br /&gt;
Cell.NumberFormat = NumberFormatId&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''Format Cells''' dialog in {{OOo}} Calc provides an overview of the different formatting options for cells.&lt;br /&gt;
&lt;br /&gt;
== Page Properties ==&lt;br /&gt;
&lt;br /&gt;
Page properties are the formatting options that position document content on a page as well as visual elements that are repeated page after page. These include&lt;br /&gt;
&lt;br /&gt;
* Paper formats&lt;br /&gt;
* Page margins&lt;br /&gt;
* Headers and footers.&lt;br /&gt;
&lt;br /&gt;
The procedure for defining page formats differs from other forms of formatting. Whereas cell, paragraph, and character elements can be formatted directly, page formats can also be defined and indirectly applied using page styles. For example, headers or footers are added to the page style.&lt;br /&gt;
&lt;br /&gt;
The following sections describe the main formatting options for spreadsheet pages. Many of the styles that are described are also available for text documents. The page properties that are valid for both types of documents are defined in the &amp;lt;idl&amp;gt;com.sun.star.style.PageProperties&amp;lt;/idl&amp;gt; service. The page properties that only apply to spreadsheet documents are defined in the &amp;lt;idl&amp;gt;com.sun.star.sheet.TablePageStyle&amp;lt;/idl&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
{{VBAnote|The page properties (page margins, borders, and so on) for a Microsoft Office document are defined by means of a &amp;lt;tt&amp;gt;PageSetup&amp;lt;/tt&amp;gt; object at the &amp;lt;tt&amp;gt;Worksheet&amp;lt;/tt&amp;gt; object (Excel) or &amp;lt;tt&amp;gt;Document&amp;lt;/tt&amp;gt; object (Word) level. In {{OOo}}, these properties are defined using a page style which in turn is linked to the associated document.}}&lt;br /&gt;
&lt;br /&gt;
== Page Background ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;idl&amp;gt;com.sun.star.style.PageProperties&amp;lt;/idl&amp;gt; service defines the following properties of a pages background:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;BackColor (long)&amp;lt;/tt&amp;gt;:color of background&lt;br /&gt;
;&amp;lt;tt&amp;gt;BackGraphicURL (String)&amp;lt;/tt&amp;gt;:URL of the background graphics that you want to use&lt;br /&gt;
;&amp;lt;tt&amp;gt;BackGraphicFilter (String)&amp;lt;/tt&amp;gt;:name of the filter for interpreting the background graphics&lt;br /&gt;
;&amp;lt;tt&amp;gt;BackGraphicLocation (Enum)&amp;lt;/tt&amp;gt;:position of the background graphics (value according to enumeration)&lt;br /&gt;
;&amp;lt;tt&amp;gt;BackTransparent (Boolean)&amp;lt;/tt&amp;gt;:makes the background transparent&lt;br /&gt;
&lt;br /&gt;
== Page Format ==&lt;br /&gt;
&lt;br /&gt;
The page format is defined using the following properties of the &amp;lt;idl&amp;gt;com.sun.star.style.PageProperties&amp;lt;/idl&amp;gt; service:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;IsLandscape (Boolean)&amp;lt;/tt&amp;gt;:landscape format&lt;br /&gt;
;&amp;lt;tt&amp;gt;Width (long)&amp;lt;/tt&amp;gt;:width of page in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;Height (long)&amp;lt;/tt&amp;gt;:height of page in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;PrinterPaperTray (String)&amp;lt;/tt&amp;gt;:name of the printer paper tray that you want to use&lt;br /&gt;
&lt;br /&gt;
The following example sets the page size of the &amp;quot;Default&amp;quot; page style to the DIN A5 landscape format (height 14.8 cm, width 21 cm):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim Doc As Object&lt;br /&gt;
Dim Sheet As Object&lt;br /&gt;
Dim StyleFamilies As Object &lt;br /&gt;
Dim PageStyles As Object&lt;br /&gt;
Dim DefPage As Object&lt;br /&gt;
&lt;br /&gt;
Doc = ThisComponent&lt;br /&gt;
StyleFamilies = Doc.StyleFamilies&lt;br /&gt;
PageStyles = StyleFamilies.getByName(&amp;quot;PageStyles&amp;quot;)&lt;br /&gt;
DefPage = PageStyles.getByName(&amp;quot;Default&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
DefPage.IsLandscape = True&lt;br /&gt;
DefPage.Width = 21000&lt;br /&gt;
DefPage.Height = 14800&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Page Margin, Border, and Shadow ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;idl&amp;gt;com.sun.star.style.PageProperties&amp;lt;/idl&amp;gt; service provides the following properties for adjusting page margins as well as borders and shadows:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;LeftMargin (long)&amp;lt;/tt&amp;gt;:width of the left hand page margin in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;RightMargin (long)&amp;lt;/tt&amp;gt;:width of the right hand page margin in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;TopMargin (long)&amp;lt;/tt&amp;gt;:width of the top page margin in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;BottomMargin (long)&amp;lt;/tt&amp;gt;:width of the bottom page margin in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;LeftBorder (struct)&amp;lt;/tt&amp;gt;:specifications for left-hand line of page border (&amp;lt;idl&amp;gt;com.sun.star.table.BorderLine&amp;lt;/idl&amp;gt; structure)&lt;br /&gt;
;&amp;lt;tt&amp;gt;RightBorder (struct)&amp;lt;/tt&amp;gt;:specifications for right-hand line of page border (&amp;lt;idl&amp;gt;com.sun.star.table.BorderLine&amp;lt;/idl&amp;gt; structure)&lt;br /&gt;
;&amp;lt;tt&amp;gt;TopBorder (struct)&amp;lt;/tt&amp;gt;:specifications for top line of page border (&amp;lt;idl&amp;gt;com.sun.star.table.BorderLine&amp;lt;/idl&amp;gt; structure)&lt;br /&gt;
;&amp;lt;tt&amp;gt;BottomBorder (struct)&amp;lt;/tt&amp;gt;:specifications for bottom line of page border (&amp;lt;idl&amp;gt;com.sun.star.table.BorderLine&amp;lt;/idl&amp;gt; structure)&lt;br /&gt;
;&amp;lt;tt&amp;gt;LeftBorderDistance (long)&amp;lt;/tt&amp;gt;:distance between left-hand page border and page content in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;RightBorderDistance (long)&amp;lt;/tt&amp;gt;:distance between right-hand page border and page content in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;TopBorderDistance (long)&amp;lt;/tt&amp;gt;:distance between top page border and page content in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;BottomBorderDistance (long)&amp;lt;/tt&amp;gt;:distance between bottom page border and page content in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;ShadowFormat (struct)&amp;lt;/tt&amp;gt;:specifications for shadow of content area of page (&amp;lt;idl&amp;gt;com.sun.star.table.ShadowFormat&amp;lt;/idl&amp;gt; structure)&lt;br /&gt;
&lt;br /&gt;
The following example sets the left and right-hand borders of the &amp;quot;Default&amp;quot; page style to 1 centimeter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim Doc As Object&lt;br /&gt;
Dim Sheet As Object&lt;br /&gt;
Dim StyleFamilies As Object &lt;br /&gt;
Dim PageStyles As Object&lt;br /&gt;
Dim DefPage As Object&lt;br /&gt;
&lt;br /&gt;
Doc = ThisComponent&lt;br /&gt;
StyleFamilies = Doc.StyleFamilies&lt;br /&gt;
PageStyles = StyleFamilies.getByName(&amp;quot;PageStyles&amp;quot;)&lt;br /&gt;
DefPage = PageStyles.getByName(&amp;quot;Default&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
DefPage.LeftMargin = 1000&lt;br /&gt;
DefPage.RightMargin = 1000&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Headers and Footers ==&lt;br /&gt;
&lt;br /&gt;
The headers and footers of a document form part of the page properties and are defined using the &amp;lt;idl&amp;gt;com.sun.star.style.PageProperties&amp;lt;/idl&amp;gt; service. The properties for formatting headers are:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderIsOn (Boolean)&amp;lt;/tt&amp;gt;:header is activated&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderLeftMargin (long)&amp;lt;/tt&amp;gt;:distance between header and left-hand page margin in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderRightMargin (long)&amp;lt;/tt&amp;gt;:distance between header and right-hand page margin in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderBodyDistance (long)&amp;lt;/tt&amp;gt;:distance between header and main body of document in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderHeight (long)&amp;lt;/tt&amp;gt;:height of header in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderIsDynamicHeight (Boolean)&amp;lt;/tt&amp;gt;:height of header is automatically adapted to content&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderLeftBorder (struct)&amp;lt;/tt&amp;gt;:details of the left-hand border of frame around header (&amp;lt;idl&amp;gt;com.sun.star.table.BorderLine&amp;lt;/idl&amp;gt; structure)&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderRightBorder (struct)&amp;lt;/tt&amp;gt;:details of the right-hand border of frame around header (&amp;lt;idl&amp;gt;com.sun.star.table.BorderLine&amp;lt;/idl&amp;gt; structure)&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderTopBorder (struct)&amp;lt;/tt&amp;gt;:details of the top line of the border around header (&amp;lt;idl&amp;gt;com.sun.star.table.BorderLine&amp;lt;/idl&amp;gt; structure)&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderBottomBorder (struct)&amp;lt;/tt&amp;gt;:details of the bottom line of the border around header (&amp;lt;idl&amp;gt;com.sun.star.table.BorderLine&amp;lt;/idl&amp;gt; structure)&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderLeftBorderDistance (long)&amp;lt;/tt&amp;gt;:distance between left-hand border and content of header in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderRightBorderDistance (long)&amp;lt;/tt&amp;gt;:distance between right-hand border and content of header in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderTopBorderDistance (long)&amp;lt;/tt&amp;gt;:distance between top border and content of header in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderBottomBorderDistance (long)&amp;lt;/tt&amp;gt;:distance between bottom border and content of header in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderIsShared (Boolean)&amp;lt;/tt&amp;gt;:headers on even and odd pages have the same content (refer to &amp;lt;tt&amp;gt;HeaderText&amp;lt;/tt&amp;gt; , &amp;lt;tt&amp;gt;HeaderTextLeft&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;HeaderTextRight&amp;lt;/tt&amp;gt; )&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderBackColor (long)&amp;lt;/tt&amp;gt;:background color of header&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderBackGraphicURL (String)&amp;lt;/tt&amp;gt;:URL of the background graphics that you want to use&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderBackGraphicFilter (String)&amp;lt;/tt&amp;gt;:name of the filter for interpreting the background graphics for the header&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderBackGraphicLocation (Enum)&amp;lt;/tt&amp;gt;:position of the background graphics for the header (value according to &amp;lt;idl&amp;gt;com.sun.star.style.GraphicLocation&amp;lt;/idl&amp;gt; enumeration)&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderBackTransparent (Boolean)&amp;lt;/tt&amp;gt;:shows the background of the header as transparent&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderShadowFormat (struct)&amp;lt;/tt&amp;gt;:details of shadow of header (&amp;lt;idl&amp;gt;com.sun.star.table.ShadowFormat&amp;lt;/idl&amp;gt; structure)&lt;br /&gt;
&lt;br /&gt;
The properties for formatting footers are:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterIsOn (Boolean)&amp;lt;/tt&amp;gt;:footer is activated&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterLeftMargin (long)&amp;lt;/tt&amp;gt;:distance between footer and left-hand page margin in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterRightMargin (long)&amp;lt;/tt&amp;gt;:distance between footer and right-hand page margin in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterBodyDistance (long)&amp;lt;/tt&amp;gt;:distance between footer and main body of document in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterHeight (long)&amp;lt;/tt&amp;gt;:height of footer in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterIsDynamicHeight (Boolean)&amp;lt;/tt&amp;gt;:height of footer is adapted automatically to the content&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterLeftBorder (struct)&amp;lt;/tt&amp;gt;:details of left-hand line of border around footer (&amp;lt;idl&amp;gt;com.sun.star.table.BorderLine&amp;lt;/idl&amp;gt; structure)&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterRightBorder (struct)&amp;lt;/tt&amp;gt;:details of right-hand line of border around footer (&amp;lt;idl&amp;gt;com.sun.star.table.BorderLine&amp;lt;/idl&amp;gt; structure)&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterTopBorder (struct)&amp;lt;/tt&amp;gt;:details of top line of border around footer (&amp;lt;idl&amp;gt;com.sun.star.table.BorderLine&amp;lt;/idl&amp;gt; structure)&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterBottomBorder (struct)&amp;lt;/tt&amp;gt;:details of bottom line of border around footer (&amp;lt;idl&amp;gt;com.sun.star.table.BorderLine&amp;lt;/idl&amp;gt; structure)&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterLeftBorderDistance (long)&amp;lt;/tt&amp;gt;:distance between left-hand border and content of footer in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterRightBorderDistance (long)&amp;lt;/tt&amp;gt;:distance between right-hand border and content of footer in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterTopBorderDistance (long)&amp;lt;/tt&amp;gt;:distance between top border and content of footer in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterBottomBorderDistance (long)&amp;lt;/tt&amp;gt;:distance between bottom border and content of footer in hundredths of a millimeter&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterIsShared (Boolean)&amp;lt;/tt&amp;gt;:the footers on the even and odd pages have the same content (refer to &amp;lt;tt&amp;gt;FooterText&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;FooterTextLeft&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;FooterTextRight&amp;lt;/tt&amp;gt; )&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterBackColor (long)&amp;lt;/tt&amp;gt;:background color of footer&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterBackGraphicURL (String)&amp;lt;/tt&amp;gt;:URL of the background graphics that you want to use&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterBackGraphicFilter (String)&amp;lt;/tt&amp;gt;:name of the filter for interpreting the background graphics for the footer&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterBackGraphicLocation (Enum)&amp;lt;/tt&amp;gt;:position of background graphics for the footer (value according to &amp;lt;idl&amp;gt;com.sun.star.style.GraphicLocation&amp;lt;/idl&amp;gt; enumeration)&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterBackTransparent (Boolean) &amp;lt;/tt&amp;gt;:shows the background of the footer as transparent&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterShadowFormat (struct)&amp;lt;/tt&amp;gt;:details of shadow of footer (&amp;lt;idl&amp;gt;com.sun.star.table.ShadowFormat&amp;lt;/idl&amp;gt; structure)&lt;br /&gt;
&lt;br /&gt;
== Changing the Text of Headers and Footers ==&lt;br /&gt;
&lt;br /&gt;
The content of headers and footers in a spreadsheet is accessed through the following properties:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;LeftPageHeaderContent (Object)&amp;lt;/tt&amp;gt;:content of headers for even pages (&amp;lt;idl&amp;gt;com.sun.star.sheet.HeaderFooterContent&amp;lt;/idl&amp;gt; service)&lt;br /&gt;
;&amp;lt;tt&amp;gt;RightPageHeaderContent (Object)&amp;lt;/tt&amp;gt;:content of headers for odd pages (&amp;lt;idl&amp;gt;com.sun.star.sheet.HeaderFooterContent&amp;lt;/idl&amp;gt; service)&lt;br /&gt;
;&amp;lt;tt&amp;gt;LeftPageFooterContent (Object)&amp;lt;/tt&amp;gt;:content of footers for even pages (&amp;lt;idl&amp;gt;com.sun.star.sheet.HeaderFooterContent&amp;lt;/idl&amp;gt; service)&lt;br /&gt;
;&amp;lt;tt&amp;gt;RightPageFooterContent (Object)&amp;lt;/tt&amp;gt;:content of footers for odd pages (&amp;lt;idl&amp;gt;com.sun.star.sheet.HeaderFooterContent&amp;lt;/idl&amp;gt; service)&lt;br /&gt;
&lt;br /&gt;
If you do not need to distinguish between headers or footers for odd and even pages (the &amp;lt;tt&amp;gt;FooterIsShared&amp;lt;/tt&amp;gt; property is &amp;lt;tt&amp;gt;False&amp;lt;/tt&amp;gt;), then set the properties for headers and footers on odd pages.&lt;br /&gt;
&lt;br /&gt;
All the named objects return an object that supports the &amp;lt;idl&amp;gt;com.sun.star.sheet.HeaderFooterContent&amp;lt;/idl&amp;gt; service. By means of the (non-genuine) properties &amp;lt;tt&amp;gt;LeftText&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;CenterText&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;RightText&amp;lt;/tt&amp;gt;, this service provides three text elements for the headers and footers of {{OOo}} Calc.&lt;br /&gt;
&lt;br /&gt;
The following example writes the &amp;quot;Just a Test.&amp;quot; value in the left-hand text field of the header from the &amp;quot;Default&amp;quot; template.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim Doc As Object&lt;br /&gt;
Dim Sheet As Object&lt;br /&gt;
Dim StyleFamilies As Object &lt;br /&gt;
Dim PageStyles As Object&lt;br /&gt;
Dim DefPage As Object&lt;br /&gt;
Dim HText As Object&lt;br /&gt;
Dim HContent As Object&lt;br /&gt;
Doc = ThisComponent&lt;br /&gt;
StyleFamilies = Doc.StyleFamilies&lt;br /&gt;
PageStyles = StyleFamilies.getByName(&amp;quot;PageStyles&amp;quot;)&lt;br /&gt;
DefPage = PageStyles.getByName(&amp;quot;Default&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
DefPage.HeaderIsOn = True&lt;br /&gt;
HContent = DefPage.RightPageHeaderContent&lt;br /&gt;
HText = HContent.LeftText&lt;br /&gt;
HText.String = &amp;quot;Just a Test.&amp;quot;&lt;br /&gt;
DefPage.RightPageHeaderContent = HContent&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note the last line in the example: Once the text is changed, the &amp;lt;tt&amp;gt;TextContent&amp;lt;/tt&amp;gt; object must be assigned to the header again so that the change is effective.&lt;br /&gt;
&lt;br /&gt;
Another mechanism for changing the text of headers and footers is available for text documents ({{OOo}} Writer) because these consist of a single block of text. The following properties are defined in the &amp;lt;idl&amp;gt;com.sun.star.style.PageProperties&amp;lt;/idl&amp;gt; service:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderText (Object) &amp;lt;/tt&amp;gt;:text object with content of the header (&amp;lt;idl&amp;gt;com.sun.star.text.XText&amp;lt;/idl&amp;gt; service)&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderTextLeft (Object)&amp;lt;/tt&amp;gt;:text object with content of headers on left-hand pages (&amp;lt;idl&amp;gt;com.sun.star.text.XText&amp;lt;/idl&amp;gt; service)&lt;br /&gt;
;&amp;lt;tt&amp;gt;HeaderTextRight (Object)&amp;lt;/tt&amp;gt;:text object with content of headers on right-hand pages (&amp;lt;idl&amp;gt;com.sun.star.text.XText&amp;lt;/idl&amp;gt; service)&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterText (Object)&amp;lt;/tt&amp;gt;:text object with content of the footer (&amp;lt;idl&amp;gt;com.sun.star.text.XText&amp;lt;/idl&amp;gt; service)&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterTextLeft (Object)&amp;lt;/tt&amp;gt;:text object with content of footers on left-hand pages (&amp;lt;idl&amp;gt;com.sun.star.text.XText&amp;lt;/idl&amp;gt; service)&lt;br /&gt;
;&amp;lt;tt&amp;gt;FooterTextRight (Object)&amp;lt;/tt&amp;gt;:text object with content of footers on right-hand pages (&amp;lt;idl&amp;gt;com.sun.star.text.XText&amp;lt;/idl&amp;gt; service)&lt;br /&gt;
&lt;br /&gt;
The following example creates a header in the &amp;quot;Default&amp;quot; page style for text documents and adds the text &amp;quot;Just a Test&amp;quot; to the header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;oobas&amp;quot;&amp;gt;&lt;br /&gt;
Dim Doc As Object&lt;br /&gt;
Dim Sheet As Object&lt;br /&gt;
Dim StyleFamilies As Object &lt;br /&gt;
Dim PageStyles As Object&lt;br /&gt;
Dim DefPage As Object&lt;br /&gt;
Dim HText As Object&lt;br /&gt;
&lt;br /&gt;
Doc = ThisComponent&lt;br /&gt;
StyleFamilies = Doc.StyleFamilies&lt;br /&gt;
PageStyles = StyleFamilies.getByName(&amp;quot;PageStyles&amp;quot;)&lt;br /&gt;
DefPage = PageStyles.getByName(&amp;quot;Default&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
DefPage.HeaderIsOn = True&lt;br /&gt;
HText = DefPage.HeaderText &lt;br /&gt;
&lt;br /&gt;
HText.String = &amp;quot;Just a Test.&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this instance, access is provided directly through the &amp;lt;tt&amp;gt;HeaderText&amp;lt;/tt&amp;gt; property of the page style rather than the &amp;lt;tt&amp;gt;HeaderFooterContent&amp;lt;/tt&amp;gt; object.&lt;br /&gt;
&lt;br /&gt;
== Centering (Spreadsheets Only) ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;idl&amp;gt;com.sun.star.sheet.TablePageStyle&amp;lt;/idl&amp;gt; service is only used in {{OOo}} Calc page styles and allows cell ranges that you want printed to be centered on the page. This service provides the following properties:&lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;CenterHorizontally (Boolean)&amp;lt;/tt&amp;gt;:table content is centered horizontally&lt;br /&gt;
;&amp;lt;tt&amp;gt;CenterVertically (Boolean)&amp;lt;/tt&amp;gt;:table content is centered vertically&lt;br /&gt;
&lt;br /&gt;
== Definition of Elements to be Printed (Spreadsheets Only) ==&lt;br /&gt;
&lt;br /&gt;
When you format sheets, you can define whether page elements are visible. For this purpose, the &amp;lt;idl&amp;gt;com.sun.star.sheet.TablePageStyle&amp;lt;/idl&amp;gt; service provides the following properties: &lt;br /&gt;
&lt;br /&gt;
;&amp;lt;tt&amp;gt;PrintAnnotations (Boolean)&amp;lt;/tt&amp;gt;:prints cell comments&lt;br /&gt;
;&amp;lt;tt&amp;gt;PrintGrid (Boolean)&amp;lt;/tt&amp;gt;:prints the cell gridlines&lt;br /&gt;
;&amp;lt;tt&amp;gt;PrintHeaders (Boolean)&amp;lt;/tt&amp;gt;:prints the row and column headings&lt;br /&gt;
;&amp;lt;tt&amp;gt;PrintCharts (Boolean)&amp;lt;/tt&amp;gt;:prints charts contained in a sheet&lt;br /&gt;
;&amp;lt;tt&amp;gt;PrintObjects (Boolean)&amp;lt;/tt&amp;gt;:prints embedded objects&lt;br /&gt;
;&amp;lt;tt&amp;gt;PrintDrawing (Boolean)&amp;lt;/tt&amp;gt;:prints draw objects&lt;br /&gt;
;&amp;lt;tt&amp;gt;PrintDownFirst (Boolean)&amp;lt;/tt&amp;gt;:if the contents of a sheet extend across several pages, they are first printed in vertically descending order, and then down the right-hand side.&lt;br /&gt;
;&amp;lt;tt&amp;gt;PrintFormulas (Boolean)&amp;lt;/tt&amp;gt;:prints the formulas instead of the calculated values&lt;br /&gt;
;&amp;lt;tt&amp;gt;PrintZeroValues (Boolean)&amp;lt;/tt&amp;gt;:prints the zero values&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
{{PDL1}}&lt;/div&gt;</summary>
		<author><name>Sancho</name></author>
		
	</entry>
</feed>