Ver Mensaje Individual
  #8  
Antiguo 02-03-2009
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Reputación: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Usé Delphi 7, y éste es el ejemplo:

Código Delphi [-]
var
  Excel: OleVariant;
  Libro: OleVariant;
  Hoja: OleVariant;

begin
  Excel := ComObj.CreateOleObject('Excel.Application');

  Libro := Excel.Workbooks.Add();
  Hoja := Libro.WorkSheets[1];

  Hoja.Cells[1, 1] := 'id';
  Hoja.Cells[1, 2] := 'nombre';

  Hoja.Cells[2, 1] := '1';
  Hoja.Cells[2, 2] := 'hugo';

  Hoja.Cells[3, 1] := '2';
  Hoja.Cells[3, 2] := 'paco';

  Hoja.Cells[4, 1] := '3';
  Hoja.Cells[4, 2] := 'luis';

  Excel.Visible := true;
end;

Claro que aquí no tengo un dataset, pero esto ya sería los de menos ¿no?

// Saludos
Responder Con Cita