Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Filter / Suppress Post Reply Post New Topic
Author Message
deprerama
Newbie
Newbie


Joined: 05 Dec 2012
Online Status: Offline
Posts: 4
Quote deprerama Replybullet Topic: Filter / Suppress
     Posted: 12 Dec 2012 at 11:36pm
I've been trying to learn ways to filter out unwanted data from a report without altering the database and I think I reached the point where I might progress faster by asking people for support (or I just kinda got fed up with it). So I hope that somebody here will be kind enough to take the time to read this and maybe give me some kind of guidelines/help since I'm not even sure if I'm on the right path here.

So first, here the setup of the report that I'm currently working on:

Visualisation: http://postimage.org/image/hpkyrhw1x/

Attempt to explain fields
A:Beton W=0.22    rmi_cad_type_id1.NAME
Decke             rmi_cad_object_kind1.NAME
Volumen           rmi_cad_value_kind1.NAME
316.29            rmi_cad_object_value1.VALUE
1 - 18            @tZähler
31 - 228          Actual amount of data lines


Suppression for Details
{rmi_cad_object_kind1.LANGUAGE_ID} <> 1 
or {rmi_cad_value_kind1.LANGUAGE_ID} <> 1
or {rmi_cad_value_kind1.NAME} <> "Volumen"


The correct counter "@tZähler"
global numberVar nTest;

if {rmi_cad_object_kind1.LANGUAGE_ID} <> 1
or {rmi_cad_value_kind1.LANGUAGE_ID} <> 1
or {rmi_cad_value_kind1.NAME} <> "Volumen"

then
    If Previous({rmi_cad_object_value1.VALUE}) <> {rmi_cad_object_value1.VALUE}
    then
    nTest := 0
    else
    nTest:= nTest
else


    If Previous({rmi_cad_object_value1.VALUE}) <> {rmi_cad_object_value1.VALUE}
         then
            (nTest := 0;
             nTest)
        else
            (
            nTest := nTest + 1;
            nTest)


This is purely for practice. It isn't supposed to be pretty or make too much sense for now. The only goal is to unclutter it. The database itself is filled with data about a building. Doors, walls, windows, lengths, areas and much other stuff... and that in three languages.
With the trial and error method I managed to filter out a big part of it and, which ended up taking forever for some reason, count the visible data lines. Though obvously I'm still far away from the ideal.

The goal would be a single line output that would look somewhat like this:

18x A:Beton W=0.22     Decke    Volumen 316.29


So basically just the very last line of the group would be good enough, with some slight changes, anyway. Also those bold numbers on the left are groups which are displayed even though they have nothing to show and I don't really know how to get rid of them.

I think if I could put the last result of the @tZähler (counter) into the group footer and just suppress all the data fields I'd be pretty close to the wanted result. The issue is that I don't really know how to do it. I kind of imagined that declaring a variable as global would make it useable "in the whole" report. But since I can't seem to be able to make a field that displays the last known state of my variable into the group footer that doesn't seem to be the case.


I'm sorry for this being slightly longer.
Thank you very much for your time~
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 13 Dec 2012 at 4:10am
If your want to filter the data coming into the report so that you only get the data that matches your filter requirements, then instead of using your "if" statement:
if {rmi_cad_object_kind1.LANGUAGE_ID} <> 1
or {rmi_cad_value_kind1.LANGUAGE_ID} <> 1
or {rmi_cad_value_kind1.NAME} <> "Volumen"
 
go to the Select Expert.  Select the {rmi_cad_object_kind1.LANGUAGE ID} field, "is equal to", 1.  Do the same type of thing to the other two fields.  When you do this, they're added to the selection criteria with "and" instead of "or".  To fix this, click on the "Formula" button in the Select Expert and edit the formula, replacing "and" with "or".
 
-Dell
IP IP Logged
deprerama
Newbie
Newbie


Joined: 05 Dec 2012
Online Status: Offline
Posts: 4
Quote deprerama Replybullet Posted: 13 Dec 2012 at 8:56pm
Uh.. well I guess that is about ten times easier than whatever I was trying to do.

Thank you for pointing that out to me.
IP IP Logged
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