21.08.2013 Views

OpenOffice.org BASIC Guide - OpenOffice.org wiki

OpenOffice.org BASIC Guide - OpenOffice.org wiki

OpenOffice.org BASIC Guide - OpenOffice.org wiki

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Definition of Elements to be Printed (Spreadsheets Only)<br />

When you format sheets, you can define whether page elements are visible. For this purpose, the<br />

com.sun.star.sheet.TablePageStyle service provides the following properties:<br />

PrintAnnotations (Boolean)<br />

prints cell comments<br />

PrintGrid (Boolean)<br />

prints the cell gridlines<br />

PrintHeaders (Boolean)<br />

prints the row and column headings<br />

PrintCharts (Boolean)<br />

prints charts contained in a sheet<br />

PrintObjects (Boolean)<br />

prints embedded objects<br />

PrintDrawing (Boolean)<br />

prints draw objects<br />

PrintDownFirst (Boolean)<br />

The Structure of Spreadsheets<br />

if the contents of a sheet extend across several pages, they are first printed in vertically descending order,<br />

and then down the right-hand side.<br />

PrintFormulas (Boolean)<br />

prints the formulas instead of the calculated values<br />

PrintZeroValues (Boolean)<br />

prints the zero values<br />

Editing Spreadsheet Documents<br />

Whereas the previous section described the main structure of spreadsheet documents, this section describes the<br />

services that allow you to easily access individual cells or cell ranges.<br />

Cell Ranges<br />

In addition to an object for individual cells (com.sun.star.table.Cell service), <strong>OpenOffice</strong>.<strong>org</strong> also provides objects<br />

that represent cell ranges. Such CellRange objects are created using the getCellRangeByName call of the<br />

spreadsheet object:<br />

Dim Doc As Object<br />

Dim Sheet As Object<br />

Dim CellRange As Object<br />

Doc = ThisComponent<br />

Sheet = Doc.Sheets.getByName("Sheet 1")<br />

CellRange = Sheet.getCellRangeByName("A1:C15")<br />

A colon (:) is used to specify a cell range in a spreadsheet document. For example, A1:C15 represents all the cells<br />

in rows 1 to 15 in columns A, B, and C.<br />

If the position of the cell range is only known at runtime, use the following code:<br />

Dim Doc As Object<br />

Dim Sheet As Object<br />

Dim CellRange As Object<br />

Chapter 7 · Spreadsheet Documents 107

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!