Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Servers
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #5  
Antiguo 29-12-2004
rruffino rruffino is offline
Miembro
 
Registrado: dic 2004
Ubicación: Berrotaran, Cordoba - Argentina
Posts: 215
Poder: 20
rruffino Va por buen camino
Aqui va el codigo

Bueno, tal como pediste te pongo el codigo a ver si puedes darme una mano. Espero puedas ayudarme y desde ya mil gracias.-

procedure TForm_excel.BitBtn_bajarClick(Sender: TObject);
var
Excel, Libro: Variant;
i: integer;
Nombre: string;
begin
try
Guardar_planilla.Execute;
if (Guardar_planilla.FileName<>'') then
begin

Excel:=CreateOleObject('Excel.Application');
Excel.Visible := True;
Nombre:=Guardar_planilla.FileName;
Excel.DisplayAlerts:=false;

//Comienzo a llenar las celdas
Excel.WorkBooks.Add();
Excel.WorkBooks[1].WorkSheets[1].Name := 'Reporte';
Libro := Excel.WorkBooks[1].WorkSheets['Reporte'];
DM.IBQuery_cob.SQL.Clear;
DM.IBQuery_cob.SQL.Add('select * from cobranza where periodo='+intToStr(DM.IBDataSet_periodoID_PERIODO.Value)+'order by fecha');
DM.IBQuery_cob.Open;
DM.IBQuery_cob.First;
i:=1;
while not (DM.IBQuery_cob.Eof) do
begin
Libro.Cells [i,1] := DM.IBQuery_cobFECHA.Value;
Libro.Cells [i,2] := DM.IBQuery_cobCONCEPTO.Value;
i:=i+1;
DM.IBQuery_cob.Next;
end;
DM.IBQuery_cob.Close;
//Acá es donde salta el error de que no soporta este metodo pero no hallo otro
Excel.SaveAs(Nombre,Null,Null,Null,false,false,xlNoChange,xlUserResolution,false,Null,Null,0);
end;
except
Excel.Quit;
showmessage('No se pudo crear el Objecto Excel.');
raise;
end;
end
;
Responder Con Cita
 



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


La franja horaria es GMT +2. Ahora son las 14:20:51.


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