Difference between revisions of "NL/Documentation/BASIC Guide/Rows and Columns"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Created page with "{{NL/Documentation/BASICGuideTOC/v2 |ShowPrevNext=block |ShowPrevPage=block |PrevPage=NL/Documentation/BASIC Guide/Structure of Spreadsheets |NextPage=NL/Documentation/BASIC G..." (tussenstap opslaan))
 
Line 25: Line 25:
 
</source>
 
</source>
  
De kolomobjecten ondersteunen de service <idl>com.sun.star.table.TableColumn</idl> die de volgende eigenschappen heeft:
+
De objecten Kolom ondersteunen de service <idl>com.sun.star.table.TableColumn</idl> die de volgende eigenschappen heeft:
  
;<tt>Width (long)</tt>:breedte va een kolom in honderdsten van een millimeter.
+
;<tt>Width (long)</tt>:breedte va een kolom in 100-en van een millimeter.
 
;<tt>OptimalWidth (Boolean)</tt>:stelt een kolom in op zijn optimale breedte.
 
;<tt>OptimalWidth (Boolean)</tt>:stelt een kolom in op zijn optimale breedte.
 
;<tt>IsVisible (Boolean)</tt>:maakt een kolom zichtbaar.
 
;<tt>IsVisible (Boolean)</tt>:maakt een kolom zichtbaar.
 
;<tt>IsStartOfNewPage (Boolean)</tt>:maakt, bij afdrukken, een pagina-einde vóór een kolom.
 
;<tt>IsStartOfNewPage (Boolean)</tt>:maakt, bij afdrukken, een pagina-einde vóór een kolom.
  
The width of a column is only optimized when the <tt>OptimalWidth</tt> property is set to <tt>True</tt>. If the width of an individual cell is changed, the width of the column that contains the cell is not changed. In terms of functionality, <tt>OptimalWidth</tt> is more of a method than a property.
+
De breedte van een kolom wordt alleen geoptimaliseerd als de eigenschap <tt>OptimalWidth</tt> is ingesteld op <tt>True</tt>. Als de breedte van een individuele cel wordt veranderd, wordt de breedte van de kolom waarin die cel is opgenomen, niet veranderd. In termen van functionaliteit is <tt>OptimalWidth</tt> meer een methode dan een eigenschap.
  
The row objects are based on the <idl>com.sun.star.table.TableRow</idl> service that has the following properties:  
+
De objecten Rij zijn gebaseerd op de service <idl>com.sun.star.table.TableRow</idl> die de volgende eigenschappen heeft:  
  
;<tt>Height (long)</tt>:height of the row in 100ths of a millimeter.
+
;<tt>Height (long)</tt>:hoogte van de rij in 100-en van een millimeter.
;<tt>OptimalHeight (Boolean)</tt>:sets the row to its optimum height.
+
;<tt>OptimalHeight (Boolean)</tt>:stelt de rij in op zijn optimale hoogte.
;<tt>IsVisible (Boolean)</tt>:displays the row.
+
;<tt>IsVisible (Boolean)</tt>:maakt de rij zichtbaar.
;<tt>IsStartOfNewPage (Boolean)</tt>:when printing, creates a page break before the row.
+
;<tt>IsStartOfNewPage (Boolean)</tt>:maakt, bij afdrukken, een pagina-einde vóór de rij.
  
If the <tt>OptimalHeight</tt> property of a row is set to the <tt>True</tt>, the row height changes automatically when the height of a cell in the row is changed. Automatic optimization continues until the row is assigned an absolute height through the <tt>Height</tt> property.
+
Als de eigenschap <tt>OptimalHeight</tt> van een rij is ingesteld op <tt>True</tt>, verandert de rijhoogte automatisch als de hoogte van de rij wordt veranderd. Automatische optimalisatie gaat door totdat de rij een absolute hoogte krijgt toegewezen via de eigenschap <tt>Height</tt>.
  
The following example activates the automatic height optimization for the first five rows in the sheet and makes the second column invisible.
+
Het volgende voorbeeld activeert de automatische hoogte-optimalisatie voor de eerste vijf rijen in het blad en maakt de tweede kolom onzichtbaar.
  
 
<source lang="oobas">
 
<source lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
Dim Sheet As Object
+
Dim Blad As Object
Dim Row As Object
+
Dim Rij As Object
Dim Col As Object
+
Dim Kolom As Object
 
Dim I As Integer
 
Dim I As Integer
  
 
Doc = ThisComponent
 
Doc = ThisComponent
Sheet = Doc.Sheets(0)
+
Blad = Doc.Sheets(0)
  
 
For I = 0 To 4
 
For I = 0 To 4
   Row = Sheet.Rows(I)
+
   Rij = Blad.Rows(I)
   Row.OptimalHeight = True
+
   Rij.OptimalHeight = True
 
Next I
 
Next I
  
Col = Sheet.Columns(1)
+
Kolom = Blad.Columns(1)
Col.IsVisible = False
+
Kolom.IsVisible = False
 
</source>
 
</source>
  
{{Documentation/Note|The <tt>Rows</tt> and <tt>Columns</tt> lists can be accessed through an index in {{OOo}} Basic. The real API call is : <tt>Sheet.getColumns.getByIndex(1)</tt> }}
+
{{Documentation/Note|De lijsten <tt>Rows</tt> en <tt>Columns</tt> kunnen worden benaderd door een index in {{OOo}} BASIC. De echte aanroep voor de API is: <tt>Blad.getColumns.getByIndex(1)</tt> }}
  
{{Documentation/VBAnote|Unlike in VBA, the first column has the index 0 and not the index 1.}}
+
{{Documentation/VBAnote|Anders dan in VBA heeft de eerste kolom de index 0 en niet de index 1.}}
  
 
== Inserting and Deleting Rows and Columns ==
 
== Inserting and Deleting Rows and Columns ==

Revision as of 12:57, 2 March 2013

Book.png


Elk blad bevat een lijst van zijn rijen en kolommen. Deze zijn beschikbaar via de eigenschappen Rows en Columns van het object werkbladdocument en ondersteunen de services com.sun.star.table.TableColumns en/of com.sun.star.table.TableRows.

Het volgende voorbeeld maakt twee objecten die verwijzen naar de eerste kolom en de eerste rij van een blad en slaan de verwijzingen op in de objectvariabelen EersteKolom en EersteRij.

Dim Doc As Object
Dim Blad As Object
Dim EersteRij As Object
Dim EersteKolom As Object
 
Doc = ThisComponent
Blad = Doc.Sheets(0)
 
EersteKolom = Blad.Columns(0)
EersteRij = Blad.Rows(0)

De objecten Kolom ondersteunen de service com.sun.star.table.TableColumn die de volgende eigenschappen heeft:

Width (long)
breedte va een kolom in 100-en van een millimeter.
OptimalWidth (Boolean)
stelt een kolom in op zijn optimale breedte.
IsVisible (Boolean)
maakt een kolom zichtbaar.
IsStartOfNewPage (Boolean)
maakt, bij afdrukken, een pagina-einde vóór een kolom.

De breedte van een kolom wordt alleen geoptimaliseerd als de eigenschap OptimalWidth is ingesteld op True. Als de breedte van een individuele cel wordt veranderd, wordt de breedte van de kolom waarin die cel is opgenomen, niet veranderd. In termen van functionaliteit is OptimalWidth meer een methode dan een eigenschap.

De objecten Rij zijn gebaseerd op de service com.sun.star.table.TableRow die de volgende eigenschappen heeft:

Height (long)
hoogte van de rij in 100-en van een millimeter.
OptimalHeight (Boolean)
stelt de rij in op zijn optimale hoogte.
IsVisible (Boolean)
maakt de rij zichtbaar.
IsStartOfNewPage (Boolean)
maakt, bij afdrukken, een pagina-einde vóór de rij.

Als de eigenschap OptimalHeight van een rij is ingesteld op True, verandert de rijhoogte automatisch als de hoogte van de rij wordt veranderd. Automatische optimalisatie gaat door totdat de rij een absolute hoogte krijgt toegewezen via de eigenschap Height.

Het volgende voorbeeld activeert de automatische hoogte-optimalisatie voor de eerste vijf rijen in het blad en maakt de tweede kolom onzichtbaar.

Dim Doc As Object
Dim Blad As Object
Dim Rij As Object
Dim Kolom As Object
Dim I As Integer
 
Doc = ThisComponent
Blad = Doc.Sheets(0)
 
For I = 0 To 4
   Rij = Blad.Rows(I)
   Rij.OptimalHeight = True
Next I
 
Kolom = Blad.Columns(1)
Kolom.IsVisible = False

Template:Documentation/Note

Documentation note.png VBA : Anders dan in VBA heeft de eerste kolom de index 0 en niet de index 1.


Inserting and Deleting Rows and Columns

The Rows and Columns objects of a sheet can access existing rows and columns as well as insert and delete them.

Dim Doc As Object
Dim Sheet As Object
Dim NewColumn As Object
 
Doc = ThisComponent
Sheet = Doc.Sheets(0)
 
Sheet.Columns.insertByIndex(3, 1)
Sheet.Columns.removeByIndex(5, 1)

This example uses the insertByIndex method to insert a new column into the fourth column position in the sheet (index 3 - numbering starts at 0). The second parameter specifies the number of columns to be inserted (in this example: one).

The removeByIndex method deletes the sixth column (index 5). Again, the second parameter specifies the number of columns that you want to delete.

The methods for inserting and deleting rows use the Rows object function in the same way as the methods shown for editing columns using the Columns object.


Content on this page is licensed under the Public Documentation License (PDL).
Personal tools