Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: supress grup header if no records Post Reply Post New Topic
Author Message
abhijeetp
Newbie
Newbie


Joined: 06 May 2008
Online Status: Offline
Posts: 5
Quote abhijeetp Replybullet Topic: supress grup header if no records
    Posted: 06 May 2008 at 6:16am

i have subreport which is taking parameters 'MyItem' and 'MySubItem' from main report

i have supress condition for detail is
 
{TEST_GET_ORDERRESULTSDATA_SP2.ORDERITEMNO}<>{?MyItem}OR
{TEST_GET_ORDERRESULTSDATA_SP2.SUBITEMNO}<>{?MySubItem}
 
now the result records have 'RecordType' field. possible values 'active', 'Inactive' and 'lapsed'. I grouped on
{TEST_GET_ORDERRESULTSDATA_SP2.RecordType}
 
now i want every group has different header as bellow
 
in page header of subreport column names
col1             col2                col3              RecordType
----------------------------------------------------------------------
----------------------------------------------------------------------
                                      Active
-----------------------------------------------------------------------
a                   b                     c                   Active
 
-----------------------------------------------------------------------
                                     Inactive
-----------------------------------------------------------------------
a1                 b1                    c1                 Inactive
 
----------------------------------------------------------------------
                                    lapsed
----------------------------------------------------------------------
a2                b2                    c2                   Lapsed
 
 
 
I tried adding 3 group header and putting suppress condition as
 
if({TEST_GET_ORDERRESULTSDATA_SP2.RECORDTYPE}<>"Lapsed")then
true
else
false
 
it gives me out put like above. but if there is no record of type laped
it shows me
----------------------------
       lapesed
---------------------------- then blank

 


Edited by abhijeetp - 06 May 2008 at 6:17am
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 06 May 2008 at 9:50am

By using suppression formulas, your subreport is reading ALL of the data every time the subreport is processed.  If it's only processed once in a report, that's not necessarily a big deal, but if it's processed for a group or a detail, that's a LOT of overhead.

Instead I would use the Select criteria for this so that your data is filtered at the database before Crystal starts processing it.  So, you would add the following to the selection formula for the subreport (parentheses ARE important here because of the OR):

{TEST_GET_ORDERRESULTSDATA_SP2.RECORDTYPE}<>"Lapsed") and
({TEST_GET_ORDERRESULTSDATA_SP2.ORDERITEMNO}<>{?MyItem}OR
{TEST_GET_ORDERRESULTSDATA_SP2.SUBITEMNO}<>{?MySubItem})
 
-Dell
IP IP Logged
abhijeetp
Newbie
Newbie


Joined: 06 May 2008
Online Status: Offline
Posts: 5
Quote abhijeetp Replybullet Posted: 07 May 2008 at 12:21am
hello dell,
 
thanks for your reply.
solved the problem.the blank was a comming as for the record which was existing in detail but was supreesed by my formula.
 
i used selection formula for the field in detail as
 
{TEST_GET_ORDERRESULTSDATA_SP2.SUBITEMNO} = {?MySubItem} and
{TEST_GET_ORDERRESULTSDATA_SP2.ORDERITEMNO} = {?MyItem}
 
 
and put a supress condition for custom group headers as
 
if({TEST_GET_ORDERRESULTSDATA_SP2.RECORDTYPE}<>'Active')then
true
else
false
 
if({TEST_GET_ORDERRESULTSDATA_SP2.RECORDTYPE}<>'Inactive')then
true
else
false
 
if({TEST_GET_ORDERRESULTSDATA_SP2.RECORDTYPE}<>'LApsed')then
true
else
false
 
Its working fine !!
 
did you mean the same??
 
thanks again for ur reply


Edited by abhijeetp - 07 May 2008 at 12:25am
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.