Ver Mensaje Individual
  #5  
Antiguo 23-08-2007
luchifer luchifer is offline
No confirmado
 
Registrado: jul 2007
Ubicación: Santa Cruz - Bolivia
Posts: 50
Reputación: 0
luchifer Va por buen camino
Impresion Directa

Mejor que este procedimiento no pude encontrar
Pruebalo !!!

Colocas un objeto excel y listo

procedure TFlis_comprob.manda_xls;
var Rango:Excel2000.Range;
I, row:integer;
bookmark:tbookmarkstr;
begin
Excelapplication1.Visible[0]:=true;
Excelapplication1.Workbooks.Add(null,0);
Rango:=Excelapplication1.ActiveCell;
for i:=0 to Qcon_det.FieldCount-1 do
begin
rango.Value:=Qcon_det.Fields[i].DisplayLabel;
rango:=rango.Next;
end;
Qcon_det.DisableControls;
bookmark:=Qcon_det.Bookmark;
Qcon_det.First;
row:=2;
while not Qcon_det.Eof do
begin
rango:=Excelapplication1.Range['A'+Inttostr(row),'A'+inttostr(row)];
for i:=0 to Qcon_det.FieldCount-1 do
begin
rango.Value:=Qcon_det.Fields[i].AsString;
rango:=rango.Next;
end;
Qcon_det.Next;
inc(row);
end;
Qcon_det.EnableControls;
rango:=Excelapplication1.Range['a1','e'+inttostr(row-1)];
rango.AutoFormat(1,null,null,null,null,null,null);
end;


Y para que funciones yo hago!!
QCon_det.Close;
QCon_det.SQL.Clear;
QCon_det.SQL.Add(Consul2);
QCon_det.Open;
if wdatxls.Checked then manda_xls else QRmayor.Preview;

y funciona excelentemente
Responder Con Cita