cancel
Showing results for 
Search instead for 
Did you mean: 

WhileReadingRecords and WhilePrintingRecords

Former Member
0 Kudos

Hi experts,

I have a formulta A with WhileReadingRecords:

WhileReadingRecords;

NumberVar Counter;

If {Hoja1_.Tipo Caso} = "Caso Agradecimiento" Then

Counter := Counter + 1

Then, I have a formula B in CROSS TAB with WhilePrintingRecords;

WhilePrintingRecords;

NumberVar Counter

Counter

The problem is that in my report I have only de CROSS TAB, but to print the COUNTER in Formula B, I need the FORMULA A in some place in the report. Why? Is there a way to print only de FORMULA B without to use FORMULA A?

thanks a lot

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Formula B contains a variable which must be evaluated so must be used in conjuction with A.

However, I am not sure why a Variable is being used.

YOu can replace A with

If {Hoja1_.Tipo Caso} = "Caso Agradecimiento" Then 1 else 0

Use this formula with in your Cross tab with a Sum.

Ian

Former Member
0 Kudos

Thank you very much. It's working.But I have another problem:

I have diferent rows for the column MONTH.

The value have Sum of @Month and RESUM with SUM:

If {Hoja1_.MES CASO} = {?Mes de Selecció} Then 1 else 0

Here its working.

But when I insert another ROW, when I'm going to edit the formula, I write the same ,what did you say me last post::

If {Hoja1_.MES CASO} = {?Mes de Selecció} Then 1 else 0

and the result is 0!!!

Why? Because its the same formula than de previous one

thank u!

Former Member
0 Kudos

I am sorry but I do not understand your question.

You satrt by saying

If {Hoja1_.MES CASO} = {?Mes de Selecció} Then 1 else 0

is working

Then you ask why ii's returning 0.

YOu are comparing a data field {Hoja1_.MES CASO} to a parameter {?Mes de Selecció}. If that condition is not true then it will return zero.

Check what data is in data field {Hoja1_.MES CASO} and parameter {?Mes de Selecció} and make sure they are compatible.

Ian

Former Member
0 Kudos

Sorry, its difficult to explain. ;( I will try ...

I have a CROSS TAB with row = type and column = YEAR.

I create a formula F1:

If {Hoja1_.AÑO CASO} <= {?Any de Selecció} Then 1 else 0

If I put this formula in the Expert Cross table as Resum fields its working. Its SUM of F1.

RESULT = 98723.

But when I put a new row in the previous view as Resum Calculate, I edit the button with the right botton and I put the same formula:

If {Hoja1_.AÑO CASO} <= {?Any de Selecció} Then 1 else 0

with the SUM of F1.

But the result is incorrect, because dont show the 98723 result, Show only 1!!

I don't understand, because its the same .. ;(

Answers (1)

Answers (1)

Former Member
0 Kudos

I want to print text based on the detail rown number.  For example:

whileprintingrecords;

numbervar x;

x:=x+1

if x = 1 then "test1";

if x = 2 then "test2";

if x = 3 then "test3"

The only thing that prints is "test3".  What am I doing wrong?

i

abhilash_kumar
Active Contributor
0 Kudos

Hi Christen,

Please post this as a separate question.

-Abhilash