Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Create Duplicat details Post Reply Post New Topic
Author Message
TrueBlue
Newbie
Newbie
Avatar

Joined: 07 Jun 2012
Location: United Kingdom
Online Status: Offline
Posts: 5
Quote TrueBlue Replybullet Topic: Create Duplicat details
     Posted: 10 Jan 2013 at 7:04am
Hi,
I'm pretty new to CR so feel free to tell me where I'm going wrong!
Basically I have a database with 3 tables I need:
Call, Ext_Call, Trip,
From those I need:
Call: ID, Name
Ext_Call: N07
Trip: SrcDepart

I can get a report to dispaly the simple details ie:
SrcDepart, ID, Name, N07

Now the issue is the SrcDepart is a departure time in mins, I have a formula that will convert to the nearest hour and I can display that fine. But I want to group and total the details by 2 versions of the time.
So Pick time = SrcDepart - 120 mins
   Depart Hr = SrcDepart (to the nearest hr)

So the problem being my two groups have the same heirachy.

I wondered if I could use an "action time" so e.g
Action time = 19:00, Pick time 19:00
Action time = 20:00, Depart Hr 20:00

So the end product would be something like
Time (19:00), Total Pick (the total of N07), Total Depart (the total of N07)

I hope this makes sense
Cheers
TB
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Jan 2013 at 8:23am
not really following what you want to accomplish here. If you need to show a single line of data twice in the same report you might consider using 2 sub reports. If you are trying to give  a user 2 views at the same data you might just use a runtime param to flip between the "views".
If you need to maintain one report with two rows of data for every one row in a table you might consider doing a union of the table to itself in a command, or create a table with only 2 rows and do a cartesion join to it.


Edited by DBlank - 10 Jan 2013 at 8:24am
IP IP Logged
TrueBlue
Newbie
Newbie
Avatar

Joined: 07 Jun 2012
Location: United Kingdom
Online Status: Offline
Posts: 5
Quote TrueBlue Replybullet Posted: 10 Jan 2013 at 11:37am
Sorry my question was confusing

Could you expand on:
"a union of the table to itself in a command, or create a table with only 2 rows and do a cartesion join to it."

Many thanks
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Jan 2013 at 11:50am
create a Command object using a union statement.
If I followed your request you would something like
 
select field_1, field_2 , field_3, field_4, 'Depart' as mintype
from tablename
union
select field_1, field_2 , field_3, field_4, 'Pick' as mintype
from tablename
 
this gives you the table twice with an extra field called mintype where all of the rows from the first use of the table has the value 'Depart' and all of the rows form the second use of the tbale has the value 'Pick' (use whatever labels youwant here).
now you have two instances of every row in the tbale and you can use the mintype field to group on and/or to control how to make your time value formula (e.g. if mintype='depart' then this calculation else ...)
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