Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Multiple Results in the same Line of Data Post Reply Post New Topic
Author Message
siweltj
Newbie
Newbie


Joined: 13 Sep 2007
Location: United States
Online Status: Offline
Posts: 16
Quote siweltj Replybullet Topic: Multiple Results in the same Line of Data
     Posted: 03 Nov 2008 at 4:39pm
I have string data set.  The data set includes entries such as 103
105A; 105B; etc.
 
I need to show each set of data that shares the same first number on the same row.
 
I also need to sort by another field entirely.
 
Any thoughts?
 
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 04 Nov 2008 at 1:41am
Hi
 
Please can you more descriptive or post more information
 
cheers
Rahul
IP IP Logged
siweltj
Newbie
Newbie


Joined: 13 Sep 2007
Location: United States
Online Status: Offline
Posts: 16
Quote siweltj Replybullet Posted: 04 Nov 2008 at 9:45am

In details I am displaying the field {EventStrings.EvStrName}

 
On the same row in details I have a formula named "AM Routes"
 
if (Right({EventStrings.EvStrName},1)="B") then {EventStrings.EvStrName} else ""
 
When {EventStrings.EvStrName} displays a result that ends with an "A" such as 103A to the left of this I need to display the result from {EventStrings.EvStrName} that has the same first three numbers but ends with a "B" such as 103B.  There are also additional results in {EventStrings.EvStrName} that will have neither an A or B such as 101 that needs to be displayed.
 
The results should appear as follows:
 
154
101
103A     103B
102
110A     110B
 
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 05 Nov 2008 at 12:51am

Hi

Edit the existing formula to
 
if (Right({Table_EVT.EVENTSTR},1)="A") then
Next{Table_EVT.EVENTSTR})
else
""
 
then  in the original field right click Select Format Field then in common tab check x+2 button against suppress  and enter the code below
 
Right({EventStrings.EvStrName},1)="B")
 
once done right click the details section and select section expert then in common tab of section expert Check the box Suppress Blank Section
 
 
Cheers
Rahul
IP IP Logged
siweltj
Newbie
Newbie


Joined: 13 Sep 2007
Location: United States
Online Status: Offline
Posts: 16
Quote siweltj Replybullet Posted: 05 Nov 2008 at 11:37am
Thanks, this works but only if records are sorted by the original field of  {EventStrings.EvStrName}.  I however, have to sort by a different field {Events.schTime} which is a time field.  So the results of {EventStrings.EvStrName} do not display in numeric order and the "B" result will not follow the "A" unit when sorted by time. 
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 06 Nov 2008 at 12:37am
Ok
 
Post me the sample data ,and what ouput you are expecting including the sorting.....
 
Cheers
Rahul
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 06 Nov 2008 at 6:28am

Hi

Build the sql as below
 
T -Parent Table
TC-Child Table
 
 
SELECT
T.EVENTTIME,
TC.EVENTTIME,
T.EVENTSTR,
TC.EVENTSTR
FROM TABLE_EVT T
LEFT JOIN TABLE_EVT tc ON  substring(T.EVENTSTR,1,3) = substring(TC.eventstr,1,3) and right(tc.eventstr,1) like '%B'
WHERE right(t.eventstr,1)  NOT LIKE '%B'
 
T.TIME                                TC.TIME                               T      TC
2008-11-05 09:00:01.000 NULL                                    154   NULL
2008-11-04 08:09:13.000 NULL                                    101   NULL
2008-11-01 05:12:08.000 2008-11-10 05:04:00.000   103A 103B
2008-05-02 07:00:00.000 NULL                                    102    NULL
2008-11-02 08:09:00.000 2008-12-06 05:00:00.000   110A 110B
 
 
Cheers
Rahul
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