Ver Mensaje Individual
  #6  
Antiguo 23-09-2007
pcicom pcicom is offline
Miembro
 
Registrado: may 2003
Ubicación: MONTERREY MEXICO
Posts: 253
Reputación: 24
pcicom Va por buen camino
OTRA FORMA es que CREES el XLS al vuelo como un archivo tipo HTML con extencin de EXCEL .xls, y despues lo abres..


Código PHP:
procedure SendToExcelFromHTML(aDataSetTDataSet); 
var
  
xFile:TextFile;
  
cFile:String
  
IRowInteger
begin 
  cFile 
:= 'reporte.xls';
  
AssignFile(xFile,cFile);
  
writeln(xFile,'<table border=1>');
  
writeln(xFile,'<th>');
  
  for 
:= 0 to aDataSet.Fields.Count do 
    
writeln(xFile,'<td>' aDataSet.Fields[i].DisplayLabel '</td>'); 

  
writeln(xFile,'</th>');
 
  try 
      
aDataSet.First
      while 
not aDataSet.EOF do 
      
begin
        Application
.processmessagess;
        
writeln(xFile,'<tr>');

        for 
:= 0 to aDataSet.Fields.Count do 
           
writeln(xFile,'<td>' aDataSet.Fields[i].AsString '</td>'); 
        
aDataSet.Next
        
writeln(xFile,'</tr>');
        
Inc(Row); 
      
end
  
finally 

  end


  
writeln(xFile,'</table>');
  
closeFile(xFile);
 
  
ShellExecute(Form1.Handle,nil,PChar(cFile),'','',SW_SHOWNORMAL);   
  
end

La cuestión es que al implementarlo demora mucho para mostrar el resultado, esto cuando el dataset es grande[/quote]

<table>
__________________
Poco ha de saber el que no pregunta.. Yo por eso soy un pregunton

Última edición por pcicom fecha: 23-09-2007 a las 15:22:22.
Responder Con Cita