Ver Mensaje Individual
  #1  
Antiguo 12-10-2011
Avatar de microbiano
microbiano microbiano is offline
Miembro
 
Registrado: sep 2008
Ubicación: Mexico D.F
Posts: 349
Reputación: 16
microbiano Va por buen camino
determinar el tamaño de fuente en excel cuando esxporto una consulta

hola resulta que no se como poner el tamano de fuente (letra) en un libro de excel cuando exporto una consulta, lo que me gustaria es saber:

* desde delphi como determinar el tamano de fuente
* desde delphi saber combinar consulta
* como determinar el separador de miles en cantidades


el codigo que utilizo para la exportacion es:
Código Delphi [-]
 Excel:=CreateOleObject('Excel.Application');
          Excel.WorkBooks.Add (-4167);

          Excel.WorkBooks[1].WorkSheets[1].Name := 'Reporte';
          Libro := Excel.WorkBooks[1].WorkSheets['Reporte'];


           // Son los titulos
          i := 10;
          Libro.Cells [1,1] := 'INSTITUTO';
          Libro.Cells [2,1]:= 'DIRECCIÓN ';
          Libro.Cells [3,1] := 'UNIDAD ';
          Libro.Cells [4,1]:= 'COORDINACIÓN ';
          Libro.Cells [5,1] := 'COORDINACIÓN ';
          Libro.Cells [6,1] := 'DIVISION';
          Libro.Cells [7,1]:=' ';
          Libro.Cells [8,1] := 'RESUMEN DE IMPORTES';

          Libro.Cells [i,1] := 'Licitación';
          Libro.Cells [i,2] := 'claves requeridas';
          Libro.Cells [i,3] := 'Piezas Requeridas';
          Libro.Cells [i,4] := 'Importe requerido';
          Libro.Cells [i,5] := 'Claves Asignadas';
          Libro.Cells [i,6] := 'Piezas Asignadas';
          Libro.Cells [i,7] := 'Importe Asignado';
          Libro.Cells [i,8] := 'importe a PMR/MEDIANA';
          Libro.Cells [i,9] := 'Ahorro Obtenido';


          with Quick_reporte_lic do
            begin
              while not Quick_reporte_lic.Qry_1.Eof do
                begin
                  i:=i+1;
                  libro.Cells[1,i ].Font.Name:='Arial'; //Tipo fuente
                  Libro.Cells [i,1] :=Qry_1.FieldByName ('licitacion').AsString;
                  Libro.Cells [i,2] :=Qry_1.FieldByName ('claves').AsInteger;
                  Libro.Cells [i,3] :=Qry_1.FieldByName ('piezas').AsInteger;
                  Libro.Cells [i,4] :=Qry_1.FieldByName ('importe').AsCurrency;
                  libro.cells.item[1,4].font.size:=4;
                  Libro.Cells [i,5] :=Qry_1.FieldByName ('claves_asig').AsInteger;
                  Libro.Cells [i,6] :=Qry_1.FieldByName ('cant_max_as').AsInteger;
                  Libro.Cells [i,7] :=Qry_1.FieldByName ('importe_asig').AsCurrency;
                  Libro.Cells [i,8] :=Qry_1.FieldByName ('importe_a_pmr').AsCurrency;
                  Libro.Cells [i,9] :=Qry_1.FieldByName ('ahorro').AsCurrency;
                  Next;
                end;  
            end;
            Excel.visible:=True;
        end;

espero me puedan ayudar de antemano muchas gracias.
Responder Con Cita