cancel
Showing results for 
Search instead for 
Did you mean: 

how to change no to yes and how to suppress a particular letter in detail?

Former Member
0 Kudos
118

Please be advised that this is how my report looks like:

Date: Employee Description Job Lot Oper No. Hrs Type Running?

3/9/09 I. Robot GR 1910 01 30 1 S NO

3/9/09 I. Robot GR 1910 01 30 3 R YES

3/10/09 I. Robot GR 1910 01 30 2 R YES

I do have grouping BY Employee, Job, Lot and Oper No.

I need help on the following:

1. On Type column I need the report to look at S and R type. If it finds an R then change the R to S and keep the Yes in Running? column

2. Once that is done then I want to suppress all the R in the report

Please help....

Edited by: 3jmj on Mar 17, 2009 10:56 PM

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

I given the points already so please close this thread

Former Member
0 Kudos

Hi,

In Section Expert Supress give the following condition

IF PREVIOUSISNULL(FIELDNAME) THEN FALSE

ELSE

IF PREVIOUS(FIELDNAME) = FIELDNAME THEN TRUE

ELSE FALSE

Regards,

Sathish

Edited by: Sathish Chandran on Mar 23, 2009 11:42 AM

Former Member
0 Kudos

this is what I have in section expert:

the first 2 lines are what is in there now and I added what was written from this forum;

{LX.LX_DATE} in {?sDate} to {?eDate} and

{LX.LX_TYPE} in "R" to "S"

IF PREVIOUSISNULL{LX.LX_TYPE} THEN FALSE

ELSE

IF PREVIOUS{LX.LX_TYPE} = FIELDNAME THEN TRUE

ELSE FALSE

RESULT AFTER CLICK CHECK (X-2): Crystal Reports box:

"The remaining text does not appear to be part of the

formula". Ok is the only option.

then I tried adding like this...

{LX.LX_DATE} in {?sDate} to {?eDate} and

{LX.LX_TYPE} in "R" to "S"; (i added semicolon here)

IF PREVIOUSISNULL{LX.LX_TYPE} THEN FALSE

ELSE

IF PREVIOUS{LX.LX_TYPE} = FIELDNAME THEN TRUE

ELSE FALSE

RESULT (X-2):

"The keyword 'then' is missing" , ok is the only option

I tried to adding 'and"

{LX.LX_DATE} in {?sDate} to {?eDate} and

{LX.LX_TYPE} in "R" to "S" and

IF PREVIOUSISNULL{LX.LX_TYPE} THEN FALSE

ELSE

IF PREVIOUS{LX.LX_TYPE} = {LX.LX_TYPE} THEN TRUE

ELSE FALSE

RESULT:

the keyword 'then' is missing, only option is ok button.

Former Member
0 Kudos

Hi,

place this in Record Selection

-


{LX.LX_DATE} in {?sDate} to {?eDate} and

{LX.LX_TYPE} in "R" to "S"

place this in Details --> Section Expert > Supress> X--2

-


IF PREVIOUSISNULL{LX.LX_TYPE} THEN FALSE

ELSE

IF PREVIOUS{LX.LX_TYPE} = FIELDNAME THEN TRUE

ELSE FALSE

Regards,

Sathish

Former Member
0 Kudos

Please be advised that when I did the first one formula written on suppressing logic for detail format, no errors found but it did not do the job

So I did the second step on the group header, after typing all written, checked for errors it gave me an error message box stating:

"the special variable 'Formula' must be assigned a value within the formula" --> OK (only option to click)

then, the cursor will blinking at the end of the word false.

What does this mean and what do i have to do, please help...

Former Member
0 Kudos

Try this formula by adding in suppress condtion of details section

whileprintingrecords;

numberVar i;

if ="R" then i:=i+1; if i>1 and ="R" then

true

else

false

Regards,

Raghavendra

Former Member
0 Kudos

Oops... Add the line


formula = ""

to the group (second) formula.

And, yes, you need both formulas...

HTH,

Carl

Former Member
0 Kudos

This solution solved the changing the no to yes. Thank you, how can I give you points for this answer?

Now the problem I am encountering after puting the formula you had given is on the detail portion of the report it gives me big blank space...this is what I meant

DATE: EMP: JOB: LOT: OPER NO: TYPE: COMPLETED? (page header)

3/1/09 John Doe 123 001 20 R yes (detail section)

3/5/09 Jane Doe 456 002 30 S no

3/6/09 Jane Doe 456 002 30 S NO

____________________________________________________________________________________

big blank space (middle detail section of the report)

____________________________________________________________________________________

3/13/09 Jane Doe 456 002 30 R YES (still part of detail section but at the bottom section of it)

note: this is the first page of the report; now on the second page of the report

it looks like this

DATE: EMP: JOB: LOT: OPER NO: TYPE: COMPLETED? (page header)

Note: top portion of the detail section of the report is blank to middle detail section of the report is still blank, now at the bottom detaiol section of the report is only 1 line which is

3/19/09 John Doe NB 002 10 R YES (still part of detail section but at the bottom section of it)

please help, how i can suppress the blank space on the detail section, this is what I meant when I said how to suppress a particular letter in the detail section. thank you, I await for your reply...

Former Member
0 Kudos

Yes, it did the yes and no but it was inconsistent. Some 'S' should say "NO" but it will say "YES" and vise versa also some 'R' should say "yes" but would say "no" and vise versa. The rest are fine giving it the right yes and no.

the only logical issue that i can see is it is confused, with the same groupings (that I have as mentioned before, is there a FORMULA stating that for every job, date, lot, and oper no, keep looking and reading under column Lx_type or Type for the 'S' first and keep answering it "NO" UNTIL it finds or reads the very first 'R' then change the last 'S' to say "YES" AND SUPPRESS all the detail line that has "R" coz the report should not show any line that has 'R' at all.

As said above I think this is where the confusion is. So if the formula would look at the "S" first hopefully this will solve this issue. Thank you...

Edited by: 3jmj on Apr 13, 2009 8:07 PM

Example:

DATE: JOB: LOT: OPER NO: TYPE: RUNNING?

3/30/09 0001999 001 12 S NO

3/31/09 0001999 001 12 S NO

4/1/09 0001999 001 12 S NO

4/2/09 0001999 001 12 S NO

4/2/09 0001999 001 12 R yes

4/3/09 0001999 001 12 R yes

BUT AS MENTIONED ABOVE CHANGE THE LAST S TO YES WHEN IT FINDS AN 'R' AND SUPPRESSING THE LINE OF ALL THE 'R'; SO BELOW SHOULD BE THE FORMAT OF THE REPORT

DATE: JOB: LOT: OPER NO: TYPE: RUNNING?

3/30/09 0001999 001 12 S NO

3/31/09 0001999 001 12 S NO

4/1/09 0001999 001 12 S NO

4/2/09 0001999 001 12 S YES

Edited by: 3jmj on Apr 13, 2009 8:12 PM

Former Member
0 Kudos

please help asap!!!

Former Member
0 Kudos

To only show the first "R" record, in the Suppress logic for the detail format, put the following (basic syntax):


global haveR as boolean

if ({Type} = "R"} then
  if (not haveR) then
    formula = false  ' show record
  else
    formula = true  ' suppress record
  end if
  haveR = true  ' remember we found an R
else
  formula = false  ' show record
end if

Then, in the group header (whichever group is used to determine "first"), put:


global haveR as boolean
haveR = false  ' reset flag at start of group

HTH,

Carl

Former Member
0 Kudos

I apologize I did not make myself clear. What I meant was how to suppress the remaining "R" after finding or seeing the first "R" under column Type. Suppressing the whole line and not touching the "S" line AND leaving only the first R it finds.

Example:

Date Emp Job Lot Oper No Type Formula1 Running?

3/9/09 JOHN 2010 01 30 S S NO

3/9/09 JOHN 2010 01 30 R S YES

3/10/09 JOHN 2010 01 30 R S YES

3/9/09 JANE 2004 02 40 R S YES

3/11/09 MARI 1909 03 60 R S YES

DESIRED RESULT TO BE:

Date Emp Job Lot Oper No Type Formula1 Running?

3/9/09 JOHN 2010 01 30 S S NO

3/9/09 JOHN 2010 01 30 R S YES

Former Member
0 Kudos

You can create the formula like this

if ="S" then

"R"

else

"S"

Name the formula as formula1 (for example)

Now right click on the section where these fields are placed and go to format section and click on X+2 corresponding to suppress condition and write the condition like this

if @formula1="R" then true

else

false

Hope this helps!

Raghavendra