Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Merging two reports... Post Reply Post New Topic
Page  of 2 Next >>
Author Message
Takesen
Senior Member
Senior Member


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 143
Quote Takesen Replybullet Topic: Merging two reports...
     Posted: 30 Jul 2009 at 9:23am
Hey everyone, again... lol
still on CRXI.
 
So, I have 2 auditing reports, they are by month by user.
almost identical formatting... they both work perfectly, but my boss wants them together, (less paper... less trees have to die yadah yadah yadah)
 
The problem with this is the timestamps i'm using are two different fields.
So when it comes breaking it down by month... the sub report i've inserted to pull the 2nd reports data, it all get's piled up (how ever many months the reports ran for it will spit data out for that user id).
 
I'm trying to figure out a way to group these up so that they are still grouped by month by user for both reports...
 
does that make sense?
If IRL is an MMO... I guess we're still in beta...
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Jul 2009 at 11:43am
Can't track you on this...can you explain further, maybe an example?
IP IP Logged
Takesen
Senior Member
Senior Member


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 143
Quote Takesen Replybullet Posted: 30 Jul 2009 at 12:12pm
Alright so i have two audit (summary) reports
 
report 1 is auditing the number of templates being created. for each month based off of the {template.createtimestamp}.
 
report 2 is auditing the number of documents being created. for each month based off of the {document.createtimestamp}.
 
i can't pass either timestamp from the reports seeing as.... both creation timestamps are different... and i don't think i can pass a date as a month to match that.... at least as far as i am aware...
 
is that any clearer?
If IRL is an MMO... I guess we're still in beta...
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Jul 2009 at 12:15pm

Are you using a parameter to define data that comes into the main report (for {template.createtimestamp}) ?

If so are you using a Date or Date time?
IP IP Logged
Takesen
Senior Member
Senior Member


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 143
Quote Takesen Replybullet Posted: 30 Jul 2009 at 12:18pm
I have a datetime parameter being passed....
would i be able to convert my createtimestamps to date format
and perhaps pass it that way?
If IRL is an MMO... I guess we're still in beta...
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Jul 2009 at 12:54pm
Yep.
Or reuse the param and just make it match date/month in the select statement
IP IP Logged
Takesen
Senior Member
Senior Member


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 143
Quote Takesen Replybullet Posted: 30 Jul 2009 at 1:08pm
Hmmm, i tried to pass it as date... but it doesn't seem to work...
I'm missing data from the sub report :(
how would i match just month/year?


Edited by Takesen - 30 Jul 2009 at 1:08pm
If IRL is an MMO... I guess we're still in beta...
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Jul 2009 at 1:25pm

Can't remember exactly how to pass a param from main to sub but there are a few posts on it if you do a search. Along the lines of you have to create a formula field, make it = the param in the main report (although I would convert it a date field here) then create the param in the sub report and link on that....

To check for the month use the dateadd function with day() ...like this...
datefield in dateadd("d",- day(param)+1,param) to dateadd("m",1, dateadd("d",- day(param),param))
IP IP Logged
Takesen
Senior Member
Senior Member


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 143
Quote Takesen Replybullet Posted: 30 Jul 2009 at 2:38pm
I might need to do some more research on how to get just the month/year to pass... ur formula wasn't too clear to me, but now i know what i'm looking for, i know how to pass the param... so half the battle's down...
 
Thanks dblank!
like always, your my hero :)
 
-Take
If IRL is an MMO... I guess we're still in beta...
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Jul 2009 at 2:49pm

dateadd("d",- day(param)+1,param) is ... take the day()value of the paramter date and subtract it from itself and then add 1 voila the firstday of the month (of that parameter date).

dateadd("m",1, dateadd("d",- day(param),param)) is ... take the paramater date and subtract the days from it which gives you the last day of the previosu month and then add 1 month to that, the last day of the month (of that parameter date).
 
Hope that helps becuase that is one ugly looking formula
IP IP Logged
Page  of 2 Next >>
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