Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Go Back   Foros Club Delphi > Principal > Varios
Register FAQ Members List Calendar Guía de estilo Search Today's Posts Mark Forums Read

Coloboración Paypal con ClubDelphi

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 14/06/2022
emeritos emeritos is offline
Miembro
 
Join Date: May 2003
Posts: 314
Poder: 24
emeritos Va por buen camino
crear varias tablas en word

Buenas estoy haciendo desde delphi7 un word y debo de crear varias tablas independiente. Este es mi codigo:

PHP Code:
    Documento := ExtractFilePathApplication.ExeName ) + ficheropdf '.docx';
    
Word.Connect;
    
Word.Documents.Add(EmptyParam,EmptyParam,EmptyParam,EmptyParam);
    
with Word do
        
Begin
          with Selection 
do
              
Begin
                  with Sections
.Item(1).Headers.Item(1).Range do
                      
Begin
                          Font
.Name := 'Arial';
                          
Font.Bold := 1;
                          
Font.Size := 14;
                          
Font.Color := clRed;
                          
Text := 'xxxxxxxxxxxxxxxxxxx ';
                          
Paragraphs.Item(1).Alignment := 1// centramos párrafo
                      
End;


                  
TypeText#13 + #13);
                   
Font.Name := 'Arial';
                   
Font.Size := 14;
                   
Font.Color := clBlack;
                   
Font.Bold := 1;
                   
TypeText'Formación NO Reglada');
                   
Font.Color := clBlue;
                   
Font.Size := 14;
                   
Paragraphs.Item(1).Alignment := 1// centramos párrafo

                   
sw_filastotal := 5;
 
                   
// Insertamos una tabla con fuente de color negro
                   
Font.Color := clBlack;
                   
with Tables.AddRangesw_filastotal3EmptyParamEmptyParam ) do
                              
begin
                                  
// Borde la la tabla
                                  
Borders.Enable := 1;

                                  
// Títulos y ancho de las columnas de la tabla
                                  
Cell(1,1).Range.Text := 'xxxxxxxxx';
                                  
Cell(1,1).Width := 200;
                                  
Cell(1,1).RightPadding;

                                  
Cell(1,2).Range.Text := ' Horas ';
                                  
Cell(1,2).Width := 60;

                                  
Cell(1,3).Range.Text := ' Puntos ';
                                  
Cell(1,3).Width := 60;

                                  
Rows.Item(1).Shading.BackgroundPatternColor := clGreen// fonfo verde
                                  
Rows.Item(1).Range.Font.Color := clYellow// fuente amarilla

                                  
MQreglada.First;
                                  While 
Not MQreglada.Eof do
                                        
Begin
                                            
// Anchura de las Celdas
                                            
Cell(sw_filas,1).Width := 200;
                                            
Cell(sw_filas,2).Width := 60;
                                            
Cell(sw_filas,3).Width := 60;

                                            
// Contenido
                                            
Cell(sw_filas,1).Range.Text := MQreglada['nombrereglada'];
                                            
Cell(sw_filas,2).Range.Text := MQreglada['horas'];
                                            
Cell(sw_filas,3).Range.Text := MQreglada['puntos'];;
                                            
sw_filas := sw_filas 1;
                                            
MQreglada.Next;
                                        
End;
                              
end;



                     
End;
                  
MQreglada.Close;

///// A partir de aqui me lo crea todo en la celda 1,1

                  
TypeText#13 + #13);
                  
Font.Name := 'Arial';
                  
Font.Size := 14;
                  
Font.Color := clBlack;
                  
Font.Bold := 1;
                  
TypeText'dddddddddddddddddddddd');
                  
Font.Color := clBlue;
                  
Font.Size := 14;
                  
with Tables.AddRangesw_filastotal3EmptyParamEmptyParam ) do
                                
begin
                                    
// Borde la la tabla
                                    
Borders.Enable := 1;

                                    
// Títulos y ancho de las columnas de la tabla
                                    
Cell(1,1).Range.Text := 'hhhhhhhhhhhhhhhhh';
                                    
Cell(1,1).Width := 100;
                                    
Cell(1,1).RightPadding;

                                    
Cell(1,2).Range.Text := ' Meses ';
                                    
Cell(1,2).Width := 60;

                                    
Cell(1,3).Range.Text := ' Puntos ';
                                    
Cell(1,3).Width := 60;

                                    
Rows.Item(1).Shading.BackgroundPatternColor := clGreen// fonfo verde
                                    
Rows.Item(1).Range.Font.Color := clYellow// fuente amarilla

                                    
MQexperiencia.First;
                                    While 
Not MQexperiencia.Eof do
                                          
Begin
                                              
// Anchura de las Celdas
                                              
Cell(sw_filas,1).Width := 100;
                                              
Cell(sw_filas,2).Width := 60;
                                              
Cell(sw_filas,3).Width := 60;

                                              
// Contenido
                                              
Cell(sw_filas,1).Range.Text := MQexperiencia['nombreexperiencia'];
                                              
Cell(sw_filas,2).Range.Text := MQexperiencia['meses'];
                                              
Cell(sw_filas,3).Range.Text := MQexperiencia['puntos'];;
                                              
sw_filas := sw_filas 1;
                                              
MQexperiencia.Next;
                                          
End;
                                
end;
                     
End;
                  
MQexperiencia.Close;

              
End;
        
End;


    
// Grabar y cerra documento
    
Word.ActiveDocument.SaveAsDocumento,
      
EmptyParamEmptyParamEmptyParamEmptyParamEmptyParamEmptyParam,
      
EmptyParamEmptyParamEmptyParamEmptyParamEmptyParamEmptyParam,
      
EmptyParamEmptyParamEmptyParam );
    
Word.Quit;
    
Word.Disconnect;
    
Word.Free
Lo primero es que la primera tabla me la crea bien y la segunda me la coloca en la celda (1,1) (junto tambien al su encabezado), de la primera tabla y no se distinguir entre la primera y la segunda aunque no es importante por que lo que quiero es crearla una debajo de la otra.

Gracias.

Last edited by Casimiro Noteví : 14/06/2022 at 16:22.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
consultas de un id en varias tablas novato_erick SQL 4 21/12/2013 19:07
Facturacion con varias tablas DOS Varios 44 20/11/2012 03:12
Crear Tablas Word Desde Delphi ciscu Servers 10 09/01/2007 17:44
consulta de varias tablas elprimo Tablas planas 3 03/01/2007 10:23
Escribiendo en varias tablas maravert Tablas planas 1 20/10/2005 17:53


All times are GMT +2. The time now is 21:10.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi