Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Impresión
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 03-12-2015
identsoft identsoft is offline
Miembro
 
Registrado: abr 2006
Posts: 282
Poder: 18
identsoft Va por buen camino
sumar campos en rave report

tengo un report desarrollado con Rave Report. Los datos los extrae de una tabla de firebird. Mi pregunta es :¿como puedo sumar( dentro del report no en delphi) cuatro campos que estan en la tabla firebird? Y una vez sumados que se puedan imprimir con el formato numerico adecuado.
Ahora mismo, lo tengo hecho de la siguiente forma: en el evento on beforeprint de la banda hago la suma y la asigno a un datatext, pero no puedo verlo con el formato adecuado.
Con CalcOp no me sirve porque solo suma dos campos(al menos que yo sepa).
¿Como se podría hacer?
Gracias y un saludo para todos
Responder Con Cita
  #2  
Antiguo 03-12-2015
Avatar de Casimiro Notevi
Casimiro Notevi Casimiro Notevi is offline
Moderador
 
Registrado: sep 2004
Ubicación: En algún lugar.
Posts: 32.037
Poder: 10
Casimiro Notevi Tiene un aura espectacularCasimiro Notevi Tiene un aura espectacular
Cita:
Empezado por identsoft Ver Mensaje
Ahora mismo, lo tengo hecho de la siguiente forma: en el evento on beforeprint de la banda hago la suma y la asigno a un datatext, pero no puedo verlo con el formato adecuado.
Pues ponle el formato que quieras.
Responder Con Cita
  #3  
Antiguo 03-12-2015
identsoft identsoft is offline
Miembro
 
Registrado: abr 2006
Posts: 282
Poder: 18
identsoft Va por buen camino
Perdon, no es un datatext, es un text component.
De todas formas en Rave Report la propiedad displayformat no esta ni en TextComponent ni en dataText component, está en cada campo del DataView.
Gracias casimiro
Responder Con Cita
  #4  
Antiguo 03-12-2015
Avatar de Casimiro Notevi
Casimiro Notevi Casimiro Notevi is offline
Moderador
 
Registrado: sep 2004
Ubicación: En algún lugar.
Posts: 32.037
Poder: 10
Casimiro Notevi Tiene un aura espectacularCasimiro Notevi Tiene un aura espectacular
Hace bastantes años que usé ravereport y se podía poner el formato, aunque no recuerdo cómo, la verdad
¿No tienes ningún ejemplo en la documentación? ¿Has buscado por los foros?
Responder Con Cita
  #5  
Antiguo 03-12-2015
identsoft identsoft is offline
Miembro
 
Registrado: abr 2006
Posts: 282
Poder: 18
identsoft Va por buen camino
Cuando se trata de un campo, no hay problema, pero la cuestion es que esto es una operacion que hay que descargar sobre (en mi caso) un textcomponent y este componente no tiene la propiedad display format. Y sí, antes de preguntar aquí, he buscado en san google pero no he encontrado nada.
Responder Con Cita
  #6  
Antiguo 03-12-2015
Avatar de Casimiro Notevi
Casimiro Notevi Casimiro Notevi is offline
Moderador
 
Registrado: sep 2004
Ubicación: En algún lugar.
Posts: 32.037
Poder: 10
Casimiro Notevi Tiene un aura espectacularCasimiro Notevi Tiene un aura espectacular
A ver si te sirve algo de esto:
Cita:
Calculations to the Max

In addition to the simple CalcText component discussed earlier, the Rave Designer includes three components for handling more complex situations: CalcTotal, CalcController, and CalcOp.
CalcTotal

The CalcTotal is a non-visual version of the CalcText component. When this component is printed, its value is typically stored in a project parameter (defined by the DestParam property) and formatted according to the DisplayFormat property. It can be useful when you're performing totaling calculations that will be used by other calculations before being printed. If the value of the CalcTotal will only be used by other calculation components, such as CalcOp, you should leave the DestParam property blank.

CalcController

CalcController is a non-visual component that acts as a controller for CalcText and CalcTotal components through their Controller properties. When the controller component is printed, it signals all calculation components that it controls to perform their operation. This process allows a report to recalculate totals on group bands, detail bands, or whole pages depending upon the location of the CalcController component.
The CalcController component can also initialize a CalcText or CalcTotal component to a specific value (through the InitCalcVar, InitDataField, and InitValue properties). The CalcController component will initialize values only if it is used in the Initializer property of CalcText or CalcTotal components.

CalcOp

CalcOp is a non-visual component that allows an operation (defined by the Operator property) to be performed on values from different data sources. The result can then be saved in a project parameter like CalcTotal, as indicated by the DestParam and DisplayFormat properties.
For example, suppose you need to add two DataText components, as in A + B = C (where A and B represent the two DataText component values and C represents the result stored in a project parameter). The three source types have many different values associated with them.
The calculation can start with different types of data sources:
  • A DataField source is a field in a table, or a DataView in Rave terms. Thus in order to choose a field, you must first select a DataView.
  • For a Value source, you fill in the property with a numeric value.
  • A CalcVar source represents another calculation variable; you can choose one from the drop-down menu that lists all the calculation variables available in the page. This value can be from another CalcOp component or from some other calculation component.
After choosing the data sources, you select the operation to be used between them. The Operator property has a drop-down menu you can use to make the appropriate choice. In the example A + B = C, the operator is coAdd.
Sometimes a function needs to be performed on a value before it is processed with the second value. In this case the source's Function property is handy. With a function, you can converted a value (such as hours to minutes), compute a trigonometric function (like the sin of the value), or perform many others calculations (such as a square root or absolute value).
Just as it is important to do the calculations in order, it is important to make sure the components are in order in the Project Tree. A report executes components down the Project Tree. For CalcOp components or any calculation component, this means they must be in the correct order. It is also important to note that if a source value is dependent on any other components (like other CalcOp components or DataText components), those components must come first in the Project Tree.
Responder Con Cita
  #7  
Antiguo 03-12-2015
identsoft identsoft is offline
Miembro
 
Registrado: abr 2006
Posts: 282
Poder: 18
identsoft Va por buen camino
Ya lo habia visto, pero el problema es que el CalOp solo suma dos campos y yo necesito sumar cuatro campos cada vez.
Una solucion seria CalcOp1(suma campo1 + campo2), CalcOp2(suma campo3 + campo4), CalcOp3(suma CalpOp1 + CalOp2).
Pero tiene que haber una solucion más sencilla.
Responder Con Cita
  #8  
Antiguo 12-01-2016
hoyosfelix hoyosfelix is offline
Miembro
 
Registrado: ago 2010
Ubicación: San Antonio, Paraguay
Posts: 38
Poder: 0
hoyosfelix Va por buen camino
Respuesta a: sumar campos en rave report

Buen día,

Según tu 1º post ya puedes traer los campos de la base de datos, si es así te suguiero que sumes los campos necesarios y formatear dentro del Rave en el DisplayFormat: #,##0.##

Por otro lado, tengo entendido que en el evento before print ya te suma bien los campos pero no es posible formatear el campo en forma numérica; podrías probar formatear el resultado como en Delphi:

Código Delphi [-]
    QuerySUMA.DisplayFormat := '#,##0.##';

Saludos.
---
hoyosfelix
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
Rave reports Campos invalidos desde delphi,pero no en el Diseñador Rave feliz-58 Impresión 5 02-09-2013 18:03:38
sumar registros segun un criterio rave report carlos munera Impresión 0 26-11-2009 05:03:50
Impresion de campos en rave report odrack Impresión 1 11-12-2008 02:17:32
Campos de una tabla en report rave !! hob Impresión 2 09-08-2006 22:04:26
rave report, concatenar campos fjolivares Impresión 1 07-10-2004 13:08:59


La franja horaria es GMT +2. Ahora son las 19:07:17.


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