Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: multiple data fields Post Reply Post New Topic
Author Message
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Topic: multiple data fields
    Posted: 19 Mar 2013 at 5:53am
i'm trying to combine the output of multiple data fields onto 1 line and i'm having some trouble. what i'm looking at is something like this

data field 1 employee name, date, hours worked, total hours
data field 2 same employee name, different date, hours worked, total hours
and so on for the days of the pay period.

what i need my report to do is to see this and output the date and hours worked on one line

so the header will be like
name, day1, day2, day3, day4, day5, total hours worked

and the details needs to combine the fields so it shows on that single line.

any thoughts?

of course any help is always appreciated!

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Mar 2013 at 7:26am
are your data fields a comma seperated string? or 4 distinct fields you were showing as sepreate using a comma in your example data?
 
can an employee have 2 rows of data with the same date and if so do you want to show the date once or twide?
 
Specfics will be determined by the answers to the above questions but basically
group on the employee
suppress the details
use a shared variable to create a string of the 'days'
in the group footer insert a text box with the emplioye + the shared variable result + the sum of hours worked
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 19 Mar 2013 at 7:37am
the data is in a table for each employee and is in a different row for each day. i'm putting together a csv export. i have the data pulling but as i mentioned i'm getting a new row for each day worked and i want just one row with all of the days worked. 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Mar 2013 at 8:04am
your using crystal to make the csv export, correct?
 
what is the raw data like in your table?
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 19 Mar 2013 at 8:07am
yeah, using crystal to write and code the report then exporting it to csv. the raw data is a table showing separate records for each employee and the day of the week that they worked. so each employee has 5 or more records for their work week. if that is making sense.  
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Mar 2013 at 8:27am

are the 'days' actual dates?

are you going to be running this with run time date params? or something like this?
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 19 Mar 2013 at 8:43am
the days are actual dates. so far i have it set up with using variables to pull the dates in as i'm hoping to use this globally with other clients that may want to use something like it. 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Mar 2013 at 9:08am

if you only have a few days your looking at and you can control the values in them (of a param or todays date) you might consider

grouping on the employee
making a series of formulas as if-then for each day
//today
if {table.date}=currentdate then {table.date}
//yesterday
if {table.date}=currentdate-1 then {table.date}
now do a maximum  of each of thes e formulas at the group footer
drag the naem into the GF, do a sum of hours at the GF
suppress the GH and details
 
another option might be a shared variable to conactenate the dates togtehr but this will be read as 1 field in the export, not many fields.
IP IP Logged
bwsanders
Senior Member
Senior Member


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 177
Quote bwsanders Replybullet Posted: 19 Mar 2013 at 9:42am
this is pretty much what i was able to figure out. i grouped them and then had to suppress my details as to only show my footer which held all the data that i wanted. 
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.029 seconds.