Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Supress certain data Post Reply Post New Topic
Author Message
Angeldust
Newbie
Newbie
Avatar

Joined: 25 Jan 2010
Location: South Africa
Online Status: Offline
Posts: 4
Quote Angeldust Replybullet Topic: Supress certain data
    Posted: 25 Jan 2010 at 4:19am

I'm trying to suppress certain details if the data in the fields is the same, but I am having problems with the formulas.

Below is the details in the report I'm busy with.

 
INVONO INVODATE DOCNO ORDERNO INWARD  TRV  AMOUNT REF_INVONO
1610035 2009/02/04 301005 1387823 2009/01/30 PETERSEN 1,235.09 
1610020 2009/02/04 301005 1387823 2009/01/30 PETERSEN 0.00 
1593660 2008/12/22 301005 1387825 2009/02/06 PETERSEN 0.00 
1613008 2009/02/10 301005 1387825 2009/02/06 PETERSEN 1,235.09 
8063460 2009/02/10 301005 1387825 2009/02/06 PETERSEN 1,235.09 1613008
1593787 2008/12/22 301005 1388045 2009/02/06 MKHWANAZI 0.00 
1593788 2008/12/22 301005 1388045 2009/01/30 MKHWANAZI 0.00 
1593784 2008/12/22 301005 1388045 2009/01/16 MKHWANAZI 0.00 
1593786 2008/12/22 301005 1388045 2009/01/23 MKHWANAZI 0.00 
 

If the Ref Invoice number equals the Invo no, both lines need to be suppressed.
If all data, except invoice number, invoice date and amount matches, then suppress.

 
What is going to be the best way to get the information I need?
Thanks


Edited by Angeldust - 25 Jan 2010 at 4:21am
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 25 Jan 2010 at 8:58am
You need to write a formula in the section expert to suppress.  Hopefully you will not need totals on this, that doubles the effort.
IP IP Logged
Angeldust
Newbie
Newbie
Avatar

Joined: 25 Jan 2010
Location: South Africa
Online Status: Offline
Posts: 4
Quote Angeldust Replybullet Posted: 25 Jan 2010 at 11:04pm
Thanks, but what formula would I use?  I just can't seem to get one that actually works :)
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 26 Jan 2010 at 11:24am

If you are comparing two rows, then the Next and Previous functions are the way to go.  At least in my experience you will need to check for first and and last records, otherwise the Next and Previous will not return a value to check.

IP IP Logged
Angeldust
Newbie
Newbie
Avatar

Joined: 25 Jan 2010
Location: South Africa
Online Status: Offline
Posts: 4
Quote Angeldust Replybullet Posted: 27 Jan 2010 at 1:36am
This is the formula I used, {TAS_INVH.REF_INVONO} = previous({TAS_INVL.INVONO}), but when I try and save the formula it tells me that a string is needed for this section of the formula: previous({TAS_INVL.INVONO}).
IP IP Logged
davejwhite
Newbie
Newbie


Joined: 19 Jan 2010
Online Status: Offline
Posts: 34
Quote davejwhite Replybullet Posted: 27 Jan 2010 at 3:35am
SOunds like a Data Type mismatch - your REF_INVONO field is a String field, whereas your INVONO field is numeric.
 
Try
{TAS_INVH.REF_INVONO} = ToText(previous({TAS_INVL.INVONO}),0,"")
 
The To Text function converts the number to a string.
The second argument (0) tells it to use zero decimal places.
The third argument ("" - empty string) tells it not to sue a thousand separator.
IP IP Logged
Angeldust
Newbie
Newbie
Avatar

Joined: 25 Jan 2010
Location: South Africa
Online Status: Offline
Posts: 4
Quote Angeldust Replybullet Posted: 27 Jan 2010 at 3:58am
that makes sense :) thanks.
I tried it, but the problem is that the Invono isn't always right before the ref invoice nbr.  Sometimes it could be quite a few lines above.  I tried without using the previous, but didn't work either.
 
IP IP Logged
davejwhite
Newbie
Newbie


Joined: 19 Jan 2010
Online Status: Offline
Posts: 34
Quote davejwhite Replybullet Posted: 27 Jan 2010 at 4:30am
Oh, I see.

Sounds like a job for an Array. I haven't got time to work this out (sorry), but here's what I'd look at:
1. Create a formula and declare a String Array
2. Store the value of the InvoNo field in the array, using ReDim Preserve so that it doesn't overwrite what it has already stored
3. Loop through the Array with each Ref_InvoNo to see if it is in the Array. This becomes the condition with which you Suppress.
 
Problem will be in going back to the line containing the original Invoice No to suppress that too.
 
Hmmm .... working ....
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.