on 2021 Apr 20 1:46 PM
Hola, buenos días.
Soy nuevo en este foro y necesito ayuda.
Lo que intento de hacer es un resumen de IVA por tipos.
Tengo estos tres campos en la base de datos
({CABECERAFACCOMPRAS.BASE1})
{CABECERAFACCOMPRAS.TIPOIVA1}
{CABECERAFACCOMPRAS.IVA1}
y esta formula en el repport
{@TIVA1}
en la formula le doy valor del tipo de IVA que quiero buscar, Ejemplo (21,00)
Creo un campo de total acumulado en el cual indico que me sume el campo ({CABECERAFACCOMPRAS.BASE1})
y en evaluar pongo esta formula
if {CABECERAFACCOMPRAS.TIPOIVA1}={@TIVA1} then Sum ({CABECERAFACCOMPRAS.BASE1})
pero no suma nada
Alguien me podria decir como hacerlo ?
The "Evaluating" part of a Running Total tells Crystal when to do the summary and needs to evaluate to either True or False. Try changing the formula to this:
{HEADERFACCOMPRAS.TIPOIVA1-lex.europa.eu = {@TIVA1}
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can't chain If statements together like this - Crystal can't process them correctly. Instead, I would do something like this:
NumberVar result := 0;
if not isNull({#BASE51}) result := {#BASE51};
if not isNull({#BASE52}) then result := result + {#BASE52};
if not isNull({#BASE53}) then result := result + {#BASE53};
result
However, it looks like you're using running totals in this formula, which may cause an issue when you try to use this in the Evaluate portion of another running total. You might need to add the following to the top of the formula:
EvaluateAfter({#BASE51});
EvaluateAfter({#BASE52});
EvaluateAfter({#BASE53});
This will ensure that the running totals have been calculated prior to getting the value of this formula.
-Dell
Muchas gracias por tu ayuda.
esta solucionado con esto que me dices
NumberVar result:=0;ifnot isNull({#BASE51})result:={#BASE51};ifnot isNull({#BASE52})thenresult:=result+{#BASE52};ifnot isNull({#BASE53})thenresult:=result+{#BASE53};result
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.