Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Need help with displaying data Post Reply Post New Topic
Author Message
dsomana
Newbie
Newbie


Joined: 03 Feb 2014
Location: United States
Online Status: Offline
Posts: 4
Quote dsomana Replybullet Topic: Need help with displaying data
     Posted: 04 Feb 2014 at 8:41am
I have a sub report in which the report looks as follows:

Group header 1
Group header 2
Group header 3
   Group header 4
                 Detail a
                 Detail b
                 Detail c
                 Detail d
                 Detail e
   Group Footer 4
Group Footer 3
Group Footer 2
Group Footer 1


Now I have a query which has five parts and I separate each part using union. So I have 5 sections in the result set. The first section goes to detail a, the second to detail b, the third section to detail c, the fourth section to detail d and the fifth section to detail e. The query may or may not return data for each section. For example the result set can contain only section 1 and section 2 or section 3 and section 4.
The problem I am facing right now is that if the section is not returned I have to display a blank section of that detail. Could you please help me out with this problem. Any suggestion would be greatly appreciated.

David
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 04 Feb 2014 at 9:09am
if you are using a command query with union
you could try

select 'Detail a' as detail_group, other_columns
from table
union
select 'Detail b' as detail_group, other_columns
from table
.. etc
then group on detail_group field
and you'll need only 1 details section
IP IP Logged
dsomana
Newbie
Newbie


Joined: 03 Feb 2014
Location: United States
Online Status: Offline
Posts: 4
Quote dsomana Replybullet Posted: 04 Feb 2014 at 9:46am
But there are 4 group headers and one of my grouping is done as you suggested. If it were a single group it would have been ok but since there are 4 group headers it doesn't work.
David
IP IP Logged
dsomana
Newbie
Newbie


Joined: 03 Feb 2014
Location: United States
Online Status: Offline
Posts: 4
Quote dsomana Replybullet Posted: 04 Feb 2014 at 9:51am
group 1 is on childs age, group 2 is on the child id, group 3 is on the section (Sections 1 to 5) and group 4 is the domain.
David
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 04 Feb 2014 at 11:22am
not sure what is your set up
another option is a suppression formula
in section expert
go to section expert next to Suppress click x-2 button
and for each of the details section
write a suppression formula like
@formula = ""
or
someFIeld = ""
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