|
|
|
|
|
- Handling a Table programmatically
<Word Processing>.InsertTable (Función) Inserts a table into a Word Processing control.
TT_Tableau.InsèreTableau(1, 3, 3)
TT_Tableau.InsèreTableau(TT_Tableau.Curseur, 3, 2)
Sintaxis
<Result> = <Word Processing control>.InsertTable(<Position> [, <Number of columns> [, <Number of rows>]])
<Result>: Variable de tipo DocFragment docFragment variable with the inserted fragment. <Word Processing control>: Nombre del control Name of the Word Processing control to use. <Position>: Integro Position where the table will be inserted. This position is expressed in number of characters. <Number of columns>: Entero opcional Number of columns in the table. This parameters corresponds to 1 by default. <Number of rows>: Entero opcional Number of rows in the table. This parameters corresponds to 1 by default. Observaciones Handling a Table programmatically A table in a Word Processing document can be handled by the WLanguage functions for managing arrays. For example:
MonDocument is Document <- TT_ExempleTT
TT_ExempleTT.InsèreTableau(1, 3, 3)
f is TT_ExempleTT.Valeur.Fragment(TT_ExempleTT.Curseur, 0)
let para <- f.Paragraphe[1]
IF para.Tableau = Null THEN
RETURN
END
doc is Document <- TT_ExempleTT.Valeur
nIndice is int = Add(para.Tableau.Lignes)
para.Tableau.Cellules[2,2].Contenu.Texte = "Je suis dans la cellule 2,2"
Delete(para.Tableau.Lignes, 3)
Delete(para.Tableau.Colonnes, 3)
Delete(doc.Paragraph, para.IndiceParagraphe)
Example for creating a table in a document with the content of a Table control:
MonDoc is Document
cTable is Control <- TABLE_Démo
pCol is Control
FragmentDeb is MonDoc.docFragment(1)
FragmentDeb.MiseEnForme.PoliceTaille = 24
FragmentDeb.MiseEnForme.CouleurTexte = DarkRed
FragmentDeb.Text = "Tableau dans TTX avec " + cTable.Libellé + CR + CR
MonDoc.DocInsèreTableau(20, TableCount(cTable, toColumn), cTable.Occurrence + 1)
FOR EACH para OF MonDoc.Paragraph
IF para.Tableau <> Null THEN
FOR nColonne = 1 _TO_ TableCount(cTable, toColumn)
pCol <- TableEnumColumn(cTable, nColonne)
para.Tableau.Cellules[1, nColonne].Contenu.Texte = pCol.Libellé
FOR nLigne = 1 _TO_ cTable.Occurrence
para.Tableau.Cellules[nLigne+1, nColonne].Contenu.Texte = pCol[nLigne]
END
END
BREAK
END
END
TT_Démo = MonDoc
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|