Ver Mensaje Individual
  #2  
Antiguo 28-09-2011
jofebas jofebas is offline
Miembro
 
Registrado: nov 2010
Posts: 50
Reputación: 14
jofebas Va por buen camino
codigo completo

Código Delphi [-]
 

    //tabla
    Hoja.Range['A' + inttostr(i+5),'A' + inttostr(i+5)].Activate;
    Hoja.PivotTableWizard(xlDatabase, 'A5:AL' + inttostr(i-4),'REPORTE',
                          'TablaDin', EmptyParam, EmptyParam, EmptyParam,
                          EmptyParam, EmptyParam, EmptyParam, EmptyParam,
                          EmptyParam, EmptyParam, EmptyParam, EmptyParam,
                          EmptyParam, lcid);
    GD := Whoja.PivotTables('TablaDin', lcid) as PivotTable;
    GD.AddFields('A','C','AL', EmptyParam);
    (GD.PivotFields('AVERAGE(AL)') as PivotField).Orientation := xlDatafield;
  end;
  RenombrarArchivo();
  if not DirectoryExists('C:\Reportes\') then CreateDir('C:\Reportes\');
  if not DirectoryExists('C:\Reportes\Inyeccion\') then CreateDir('C:\Reportes\Inyeccion\');
  Excel.ActiveWorkbook.SaveAs( ExtractFilePath( 'C:\Reportes\Inyeccion\' ) + 'ReporteOEE-Inyec.xlsx',EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, xlNoChange, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, 0);
  ShowMessage('Reporte Guardado en C:\Reportes\Inyeccion\');
  Excel.Visible[1]:=true;
  Excel.Quit;
end;
Responder Con Cita