Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > C++ Builder
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 19-04-2006
Avatar de alt126
alt126 alt126 is offline
Miembro
 
Registrado: dic 2004
Posts: 171
Poder: 20
alt126 Va por buen camino
DisplayFormat en Builder c++ 5???

Estoy intentando mostrar unos numeros decimales, de una tabla en access a un dbgrid y de ahi a un quickreport....

el problema es que al mostrame los numeros como float en el dbgrid sale con muchos decimales...me han dicho aqui que se puede arreglar con la propierdad DisplayFormat poniendo ,0.00...el problema es que no encuentro esa propiedad...no la puedo aplicar al campo de la tabla, consulta, dbgrid que yo quiero...

Uso Builder c++ 5...es problema de la version o algo el que no aparezca???

GRACIASSSS
__________________
Un saludo

Antonio
Responder Con Cita
  #2  
Antiguo 20-04-2006
Avatar de alt126
alt126 alt126 is offline
Miembro
 
Registrado: dic 2004
Posts: 171
Poder: 20
alt126 Va por buen camino
Lo pongo aqui tambien porque tiene que ver con Builder c++ 5!!

En el compilador tengo....

Propiedades del objeto "Tabla"
Código:
In TTable
CanModify
  DataSource
  DefaultIndex
  Exclusive
  Exists
  Handle
  IndexDefs
  IndexFieldCount
  IndexFieldNames
  IndexFields
  IndexFiles
  IndexName
  KeyExclusive
KeyFieldCount
  MasterFields
  MasterSource
  ReadOnly
  StoreDefs
  TableLevel
  TableName
  TableType
El metodo que utilizo para obtener el valor de un campo de una tabla es...

TField* __fastcall FieldByName(const AnsiString FieldName);

lo uso de la siguiente manera:

Tabla->FieldByName("Campo")->Tipo....En tipo pongo como quiero que me capture el dato....

AsString
AsFloat
AsInteger
AsBoolean

Propiedades del campo (Donde deberia estar DisplayFormat...pero nada)

Código:
In TField
Alignment
  AsBoolean
  AsCurrency
  AsDateTime
  AsFloat
  AsInteger
  AsString
  AsVariant
  AttributeSet
  AutoGenerateValue
  Calculated
  CanModify
  ConstraintErrorMessage
  CurValue
  CustomConstraint
DataSet
  DataSize
  DataType
  DefaultExpression
  DisplayLabel
  DisplayName
  DisplayText
  DisplayWidth
  EditMask
  EditMaskPtr
  FieldKind
  FieldName
  FieldNo
  FullName
HasConstraints
  ImportedConstraint
  Index
  IsIndexField
  IsNull
  KeyFields
  Lookup
  LookupCache
  LookupDataSet
  LookupKeyFields
  LookupList
  LookupResultField
  NewValue
Offset
  OldValue
  Origin
  ParentField
  ProviderFlags
  ReadOnly
  Required
  Size
  Text
  ValidChars
  Value
  Visible
Aunque mirando la informacion del tipo TField (es decir) el campo que yo obtengo dice:

Código:
 TField is the common ancestor of all the field components in a dataset.
Unit
db
Description
TField encapsulates the fundamental behavior common to all field components. It introduces the properties, events, and methods that are used to:
Change the value of a field in a dataset.
 Convert the value of a field from one data type to another.
 Validate data that the user enters for a field.
 Define how the data in the field appears as it is displayed or edited.
 Calculate the value of a field from code written in the OnCalcFields event of the dataset.
 Look up the field’s value from another dataset.
Do not create instances of TField. TField descendants are created automatically each time a dataset is activated. These descendants can be dynamic (the default) or persistent. Dynamic field components reflect the actual columns of the underlying physical table at the time a dataset is opened. Persistent field components are created at design time using the Fields editor, which specifies the fields in the dataset, their properties, and their ordering.
Creating persistent field components guarantees that each time an application runs, it uses and displays the same columns, in the same order, even if the physical structure of the underlying database changes. If a column on which a persistent field component is based is deleted or changed, C++Builder generates an exception rather than opening the table against a nonexistent column or mismatched data. If this happens, remove the field component for the nonexistent field using the Fields editor.
A field in a dataset is always treated as one of the following TField descendant classes below:
TADTField TDateField TReferenceField
TAggregateField TDateTimeField TSmallIntField
TArrayField TFloatField TStringField
TAutoIncField TGraphicField TTimeField
TBCDField TGuidField TVarBytesField
TBlobField TIDispatchField TVariantField
TBooleanField TIntegerField TWideStringField
TBytesField TLargeintField TWordField
TCurrencyField TMemoField 
In addition to these front-line field classes, there are a number of field classes that serve only as abstract classes. These field classes are not used to instantiate field objects, only to provide functionality for descendant classes. These abstract field classes include TBinaryField, TDataSetField, TInterfaceField, TNumericField, and TObjectField.
Y mirando las propiedades del tipo "TAggregateField"....en las propiedades si esta DisplayFormat.....

...pero no se como poder acceder a esa propiedad...

Alguna idea???
__________________
Un saludo

Antonio
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Comportamiento extraño de DisplayFormat Thales Conexión con bases de datos 0 02-12-2005 22:56:32
SQL Builder josevaldez Conexión con bases de datos 0 14-07-2005 15:58:00
GPS con Builder c++ alt126 C++ Builder 5 19-12-2004 01:28:01
DisplayFormat para campo de texto apicito Conexión con bases de datos 1 23-09-2004 16:26:39
DisplayFormat en tiempo de ejecución? mguixot OOP 4 01-06-2004 12:38:19


La franja horaria es GMT +2. Ahora son las 23:30:33.


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
Copyright 1996-2007 Club Delphi