2020-03-01

40: Set Any Page Property of Spread Sheets Document with UNO

<The previous article in this series | The table of contents of this series | The next article in this series>

Any spread sheets document typically associated with an OpenDocument Spreadsheet/Office Open XML Workbook/Microsoft Excel file, using LibreOffice

Topics


About: UNO (Universal Network Objects)
About: LibreOffice
About: Apache OpenOffice
About: the Java programming language
About: C++
About: Microsoft .NET Framework
About: the Python programming language
About: LibreOffice Basic
About: Apache OpenOffice Basic
About: BeanShell
About: JavaScript

The table of contents of this article


Starting Context



Target Context


  • The reader will know how to set any page property of any spread sheets document that is loaded in a LibreOffice or Apache OpenOffice instance, from his or her program.
Stage Direction
Here are Hypothesizer 7, Objector 40A, and Objector 40B in front of a computer.


Orientation


Hypothesizer 7
In this article, we will know how to set any page property of any spread sheets document that is loaded in a LibreOffice or Apache OpenOffice instance, from our program.

In fact, this article is an extension of a previous article on setting the size of any page of any spread sheets document.

Objector 40A
'Size' is just one of the properties, isn't it?

Hypothesizer 7
Yes, exactly, sir. So, the logic for setting any property has been already explained in the previous article and will not be repeated here; this article is about introducing what properties exist (more specifically, introducing an article that lists the properties).

Objector 40B
This article is only about spread sheets documents?

Hypothesizer 7
Basically yes, madam. Although word processor documents and spread sheet documents share many properties, some properties exist only in word processor documents and some properties exist only in spread sheet documents. So, if you are interested in word processor documents, you will want to rather see the article on word processor documents.


Main Body


1: The Logic for Setting Any Page Property of Any Spread Sheets Document


Hypothesizer 7
The logic for setting any page property of any spread sheets document has been already explained in the previous article and will not be repeated here.

Just, in the 4th section, use another property name instead of "Size" and a datum of the corresponding datum type.


2: A List of the Properties


Hypothesizer 7
Here is a list of the properties.

Objector 40A
Well . . .

Hypothesizer 7
Note that the cited property types are UNO datum types.

Objector 40A
What do you mean?

Hypothesizer 7
Each UNO datum type is mapped to a language-specific datum type in each UNO-supported programming language. For example, 'long' is mapped to 'int' (not 'long') in Java; in Python, any integral number is mapped to 'int' because there is no such thing as 'short' or 'byte'.

For the specifications of the complex types like '::com::sun::star::container::XNameContainer', please look at the UNO API reference.

Objector 40A
. . . How can I create an instance of '::com::sun::star::container::XNameContainer'?

Hypothesizer 7
You do not need to. As an instance has been already set into the property even if there is not any element, you can use the existing instance.

Objector 40A
Why do such things as "identical" properties exist?

Hypothesizer 7
Honesty, I do not know for sure, but in most cases, an identical property is the document-type-specific version of a document-types-common property. For example, 'BackColor' is common among the document types while 'BackgroundColor' is specific for spread sheets documents.


3: The Conclusion and Beyond


Hypothesizer 7
Now, we know how to set any page property of any spread sheets document that is loaded in a LibreOffice or Apache OpenOffice instance, from our program.

We will see how to set any page property of any word processor document from our program, in the next article.


References


  • N/A. (N/A). LibreOffice: Main Page. Retrieved from https://api.libreoffice.org/docs/idl/ref/index.html
<The previous article in this series | The table of contents of this series | The next article in this series>