//////////////////// mise en forme du tableau //////////////////////////////////////
With Tableau Do
Begin
Borders.Item(wdBorderLeft).LineStyle : = wdLineStyleNone;
Borders.Item(wdBorderRight).LineStyle := wdLineStyleNone;
Borders.Item(wdBorderTop).LineStyle := wdLineStyleNone;
Borders.Item(wdBorderBottom).LineStyle := wdLineStyleNone;
Borders.Item(wdBorderHorizontal).LineStyle := wdLineStyleNone;
Borders.Item(wdBorderVertical).LineStyle := wdLineStyleNone;
Borders.Shadow := False;
End;
///////////////// enregistrement de la gestion d'onglet ///////////////////////////////
if assigned(TNB_principal) then // verification de la presence du premier TNB
begin
For lecture_page: = 0 to TNB_principal.Pages.Count-1 do // lecture des differents étages
Begin
TabPageetage := TTabPage(TNB_principal.Pages.Objects[lecture_page]);
if assigned(TabPage) then
begin
Tableau.Cell(etageTableau,2).Range.Text : = TabPageetage.Caption ; //insertion de l'étage dans le tableau
BeforeRow:= Tableau.Rows.Item(Tableau.Rows.Count);
Tableau.Rows.Add(BeforeRow);
etageTableau := etageTableau+1 ;
For num_onglet: = 0 to TNB_principal1[lecture_page].Pages.Count-1 do// lecture des differentes piece
Begin
TabPagepiece := TTabPage(TNB_principal1[lecture_page].Pages.Objects[num_onglet]);
miseEnFormeMot(TabPagepiece.Caption);
Tableau.Cell(etageTableau,1).Range.Text := motFinal ; // insertion de la piece dans le tableau
For NumTableau: =0 to Pred( TabPagepiece.ControlCount ) do// recherche du composant de type checkBox du nom de CBX_test
begin
aComposant := TControl.Create(self);
aComposant := TabPagepiece.Controls[NumTableau] ;
if TabPagepiece.Controls[NumTableau] is TCheckBox then
begin
recupere_mot(aComposant.Name, Length(aComposant.Name)-3, 1);
acheck : = TCheckBox.Create(self);
acheck := (aComposant as TCheckBox);
if mots ='CBX_test' then
begin
if acheck.Checked = false then // verifier si le composant et cocher ou pas
begin
Tableau.Cell(etageTableau,3).Range.Text : = 'NON' ; // inserer l'état dans le tableau
end
else
begin
Tableau.Cell(etageTableau,3).Range.Text := 'OUI' ; // inserer l'état dans le tableau
end;
etageTableau := etageTableau+1 ;
BeforeRow:=Tableau.Rows.Item(Tableau.Rows.Count);
Tableau.Rows.Add(BeforeRow);
end;
end;
end;
end;
end;
end;
end;
///////////////// enregistrement du fichier word rempli sous un autre nom ///////////////////////////////
cs_Delphiprog
Messages postés4297Date d'inscriptionsamedi 19 janvier 2002StatutMembreDernière intervention 9 janvier 201332 16 nov. 2006 à 21:49
Sauf erreur :
BeforeRow:=Tableau.Rows.Item(Tableau.Rows.Count);
Tableau.Rows.Add(BeforeRow);
Ce code n'insère-t-il pas une ligne avant l'autre ?
Comme le reste des lignes renvoie un résultat identique, tu ne vois pas de différences entre elles.
May Delphi be with you !
<hr color="#008000" />
Pensez à cliquer sur Réponse acceptée lorsque la réponse vous convient.
http://www.afipa.net