Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Impresión (https://www.clubdelphi.com/foros/forumdisplay.php?f=4)
-   -   formato moneda en excel desde delphi (https://www.clubdelphi.com/foros/showthread.php?t=60296)

LoganFenix 26-09-2008 19:59:41

formato moneda en excel desde delphi
 
hola tengo una aplicacion en delphi q consiste en realizar consulta y en base a esa consulta me genera un reporte q es enviado a excel.
mi problema es q con los numeros quiero darles el formato moneda ($456,1254.357)y no de numero(45612543.57) parte de mi codigo para hacer el formato es
Código Delphi [-]
  vCell := Hoja.Range['A'+inttostr(ren)+':' + CHAR(num_columna)+ inttostr(ren)];
    vCell.Borders.LineStyle:= 1;
    vcell.Interior.ColorIndex := 15;
    vcell.HorizontalAlignment := 3;
    vcell.VerticalAlignment := -4160;
    vcell.WrapText := true ;
    vcell.Orientation := 0;
    vcell.AddIndent := False ;
    vcell.IndentLevel := 0 ;
    vcell.ShrinkToFit := False;
    vcell.ReadingOrder := -5002;
    vcell.MergeCells := False;
    vCell.Font.Name:='Arial';
    vCell.Font.Size:=10;
    vCell.font.bold:=true;
    vCell.Value :=XArr;
    ren := 10;
    vCell := Hoja.Range['A'+inttostr(ren)+':' + CHAR(num_columna)+ inttostr(ren)];
    vCell.Borders.LineStyle:= 0; //sin borde
    vcell.Interior.ColorIndex := -4142;//sin relleno
    vcell.HorizontalAlignment := 1; //1 es derecha 3 es centrado 2 es izquierda
    vcell.VerticalAlignment := -4160;
    vcell.WrapText := true ;//permite escribir mas de una linea(la celda)
    vcell.Orientation := 0;
    vcell.AddIndent := False ;
    vcell.IndentLevel := 0 ;
    vcell.ShrinkToFit := False;
    vcell.ReadingOrder := -5002;
    vcell.MergeCells := False;
    vCell.Font.Name:='Arial';
    vCell.Font.Size:=10;
    //vCell.
    vCell.font.bold:=false; //sin negrita
    vCell.Value :=XArr; //CONTIENE TODOS LOS VALORES DE LA LISTA

donde la variable ren=9 se refiere al renglon 9 dar ese formato y ren=10 otro formato


La franja horaria es GMT +2. Ahora son las 09:06:55.

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