Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Servers
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

 
 
Herramientas Buscar en Tema Desplegado
  #3  
Antiguo 04-11-2008
lKinGl lKinGl is offline
Miembro
 
Registrado: ago 2007
Posts: 333
Poder: 19
lKinGl Va por buen camino
Exclamation

Cita:
Empezado por ContraVeneno Ver Mensaje
Código Delphi [-] Excel:=CreateOleObject('Excel.Application'); Excel.Visible := False; Excel.DisplayAlerts:= False; Excel.WorkBooks.Add; Excel.WorkBooks[1].WorkSheets[1].Name := 'Libro'; Libro := Excel.WorkBooks[1].WorkSheets['Libro']; Libro.Cells[1,1]:='Reporte'; Libro.Cells[4,1].Font.Bold:=True; Libro.Columns.Columns[2].ColumnWidth := 50; with UnQuery do begin first; Libro.Cells[i,1]:=FieldByname('UnCampo').AsString; Libro.Cells[i,1].Font.Bold:=True; while not EOF Do begin Libro.Cells[i,1]:=FieldByName('OtroCampo').AsString; ..... Next; end; //while end; //with
salu2 contraveneno tarté de completar el código y me quedó así:
el código 1ero que nada lo puse dentro de un tbuton, agregue un componente texcelapplication

Código Delphi [-]
procedure TForm48.Button1Click(Sender: TObject);
var
libro: ExcelApplication;
begin
  ExcelApplication1:=CreateOleObject('Excel1.Application');
  ExcelApplication1.Visible := False;
  ExcelApplication1.DisplayAlerts:= False;
  ExcelApplication1.WorkBooks.Add;
  ExcelApplication1.WorkBooks[1].WorkSheets[1].Name := 'Libro';
  Libro:= ExcelApplication1.WorkBooks[1].WorkSheets['Libro'];
  Libro.Cells[1,1]:='Reporte';
  Libro.Cells[4,1].Font.Bold:=True;
  Libro.Columns.Columns[2].ColumnWidth := 50;
  with Query1 do begin
   first;
   Libro.Cells[i,1]:=FieldByname('numero').AsString;
   Libro.Cells[i,1].Font.Bold:=True;
   while not EOF Do begin
      Libro.Cells[i,1]:=FieldByName('cod_emp').AsString;
      //.....
      Next;
   end; //while
end; //with

y mira los errores que me da :S

__________________
Las cosas o son, o no son...
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
excel a delphi, como mostrar columnas de excel Vyckso Servers 2 13-08-2007 12:38:08
Pasar de TQuery a Excel? mrmanuel Varios 6 09-03-2007 13:32:41
TQuery nenufer Conexión con bases de datos 2 22-05-2006 16:41:03
Cómo exportar una tabla (TTABLE o TQUERY) completa a Excel vick Conexión con bases de datos 1 27-09-2005 09:41:35
Problema al actualizar Excel 2000 a Excel XP victork_py Servers 1 06-08-2004 19:20:41


La franja horaria es GMT +2. Ahora son las 14:46:29.


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