cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove suppressed items in the group tree from the crystal report print preview screen

Former Member
0 Kudos

I am removing items in report using group selection formula. Although the removed items are not available in the report, they are still available in the group navigation tree on the left pane. Is there a way to overcome this ?

Accepted Solutions (0)

Answers (3)

Answers (3)

abhilash_kumar
Active Contributor
0 Kudos

Hi Billu,

You cannot stop the groups from showing up on the Group Tree. You have a few choices:

1) Use a Record Selection Formula so that report only receives records that it needs

2) Turn off Group tree

-Abhilash

Former Member
0 Kudos

Hi All,

How can i use the below group selection code in record selection.

....

TotalQuantity := sum({ICIVAL.QUANTITY},{ICIVAL.ITEMNO});

TotalCost := sum({ICIVAL.TRANSCOST},{ICIVAL.ITEMNO});

iIncludeQty := TONUMBER({?INCLUDEQTY});

iIncludeCost := TONUMBER({?INCLUDECOST});

bIncludeQty := FALSE;

bIncludeCost := FALSE;

(

SELECT iIncludeQty

    CASE 0:

        bIncludeQty := TRUE

    CASE 1:

        If TotalQuantity > 0 THEN

            bIncludeQty := TRUE

    CASE 2:

        If TotalQuantity = 0 Then

            bIncludeQty := TRUE

    CASE 3:

        If TotalQuantity < 0 THEN

            bIncludeQty := TRUE

    CASE 4:

        If TotalQuantity <> 0 THEN

            bIncludeQty := TRUE

);

(

SELECT iIncludeCost

    CASE 0:

        bIncludeCost := TRUE

    CASE 1:

        If TotalCost > 0 THEN

            bIncludeCost := TRUE

    CASE 2:

        If TotalCost = 0 Then

            bIncludeCost := TRUE

    CASE 3:

        If TotalCost < 0 THEN

            bIncludeCost := TRUE

    CASE 4:

        If TotalCost <> 0 THEN

            bIncludeCost := TRUE

);

bIncludeQty AND bIncludeCost

abhilash_kumar
Active Contributor
0 Kudos

You cannot include such formulae in a Record Selection Formula. What you cao do though:

1) Create a SQL Expression (with the same logic as above) that returns true or false for each group. Example here:

Or

2) Use a SQL Query (Command Object)/ Stored Proc as the datasource for the report. The SQL Query would have all the group by and filtering logic so do you don't need to do any extra work on the report

Or

3) Use the existing report as a Subreport. The Main report will only be used to create a comma separated list of values that accumulates all the group names that show up on the report. This array will be sent to the Subreport via the 'Change Subreport Links' and then used in the Record Selection Formula.

-Abhilash

Former Member
0 Kudos

Hi Abhilash,

Thanks for your quick reply.

As you mentioned:

1) Create a SQL Expression (with the same logic as above) that returns true or false for each group.


i tried the following things but i am getting the errors - like - Error in compiling SQL Expression:


Can you please explain in the given above my code with using the SQL Expression. It will be more helpful to proceed.


And also regarding the 3rd point in your reply i am not getting with that point. can you explain more details in that will be helpful.


-BILLU


Former Member
0 Kudos

Hi Try Using record selection formula

former_member205840
Active Contributor
0 Kudos

Hi Billu,

Use Record Selection formula instead of Group selection formula. 

You will see the group elements If you use suppress or group selection formulas.  It is default behavior.

Sastry