Pergunta

I am creating a crystal report containing the FORMULA fields like Openbalance,debitamount,creditamount and closing balance in details section grouped by its type..

In this, the Previous day Closing balance will be the next day's Opening balance. Please help me out to get the Previous day Closing Balance which will be in the Open balance field.

Thanks in advance.

Foi útil?

Solução

@Shiva. Thank you so much for your idea. Its working great. But small change is needed for my requirement. I need the opening balance for each record.So I just created inter groups(i.e. first grouped the records by its name and inside,it was grouped by its serial no.,so that i can get values for each record)

Then as you said but without using the counter part.

In the footer section(grouped by Serial No), create a formula field:

    Shared Numbervar a;
    a:=//the value you want to pass

In the header section(grouped by Serial No),create a formula field:

    Shared NumberVar b;
    Shared NumberVar a;
    b:=a;

Finally,In the details section formula field,

    Shared Numbervar b;
    b

Outras dicas

Note: This is just an idea not the tested solution

Its a typical situation but one wayout is try below solution.

  1. Group the report according to Date.
  2. Store the value of the record in a Shared Variable.
  3. Now use that value when the group changes to a new one and then reset the value to zero.

To spot the first record:

In group header create a formula @count reset

Shared NumberVar count;
count:=0;

Now in detail part increment the count @Increment and supress the formula:

Shared Numbervar count;
count:=count+1;

Now to store last value and show it as the first value follow below process:

Create below formula in group footer @StoreLast.

Shared Numbervar a;
    a:=// your value that you want to pass.

Now create a formulas @Store Value and @reset in group header as below and place the formula to the left of @reset. If the placement changes the result will be zero.

@store Value

Shared NumberVar b
Shared NumberVar a;
b:=a;

@reset

Shared NumberVar a;
a:=0

Now place below formula in detail;

Shared Numbervar b;

If `{@Increment}`=1
then b
else 
//your code for the rest of values.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top