Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: whilereading or printing ???? Post Reply Post New Topic
Author Message
Irineas
Newbie
Newbie
Avatar

Joined: 04 Aug 2010
Online Status: Offline
Posts: 4
Quote Irineas Replybullet Topic: whilereading or printing ????
    Posted: 18 Feb 2011 at 4:39am
Hi all
 
I am asked to put in the header the values maxdate, mindate and maxnr p/ day and minnr. p/day
The listing looks like this, and yes there are more nr.val on one day that might be equal en Yes sometimes a number can be missed on a day,
RecDat            nr.
31-01-2011   1481
31-01-2011   1481
31-01-2011   1482
31-01-2011   1483
01-02-2011   1
01-02-2011   2
01-02-2011   3
01-02-2011   5 
 
Now , i need to put this in the header out in front of the report.
I used the month values to group the records >> group 2 = order on date
Since there is the newstart of the nr sequence on every first day of the month, i cant simpley get away with min and max vals.
I have tried with running totals , and ended up to code my own here.
 
Example;
if Cstr({@NrMonthLow}) <= Cstr({@NrMonthHigh})  then ({Opdracht.Nr})
 >> if i place this field in header or footer i  have the correct reading.
       Using min max vals did not give me any better results.
Just for more intersted i handled the moths and groups with these below 
 
 
 
({@Monthverloop}) = (month({Opdracht.RecDat}))
 
This is an efford to get that value where that maxdate is in the header.
Now it works on the low value but not on the max value.
The maxvalue is correctly shown in thye footer p/ group
 
Whilereading did not made some diff for me. 
Who has some answer please  ?
 
If whished for, ill mail you an Excel sheet from wich i get the data and the report based on that data.
 
 


Edited by Irineas - 18 Feb 2011 at 4:55am
Wisdom is not inhereted, its gained thru experiance and does naturally grow with age.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 21 Feb 2011 at 5:53am
the problem is that you are looking at values as you display them.  This can only be done at printing time, and what is the MAX value?  CR doesn't know until the data is read. Which means it can only know it in the footer.
 
If you use a stored procedure, then you can find the values that you want and place them in the records.  With value in the records, CR will know the value as soon as it starts on that group.
 
The reason that the MIN is working, is that it is probably the first value in the records, so it 'appears' to be working, but it isn't either (not really)
 
HTH
IP IP Logged
Irineas
Newbie
Newbie
Avatar

Joined: 04 Aug 2010
Online Status: Offline
Posts: 4
Quote Irineas Replybullet Posted: 21 Feb 2011 at 7:01am
Hi Lockwelle
Thanks for the response
I thought so as you wrote, I have the footer and header loaded with diff min / max vals wich are read on that true moment and only apear on start and just before groupchange towards the next group or at end of the report.
I have the groupes based on the month, so that will be limmited in use and onley apear on month endings.
 
I cant change the view of wich the data is distracted from, so this is the best possible for this moment i guess.
To bad CR has no Where clause like SQL has ;-))
Thanks, again
 


Edited by Irineas - 21 Feb 2011 at 7:03am
Wisdom is not inhereted, its gained thru experiance and does naturally grow with age.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 22 Feb 2011 at 3:07am
while it is a pain, CR is not better or worse than any other reporting tool I have used (ssrs and XtraReports) in this regards.
 
if you really need the max...you can use a subreport, they will read all of the data, which is why I tend to discourage their use...they hit the database a lot, which tends to make reports run slower.
 
again, a stored procedure removes this, and/or disconnected record sets, as the disconnected recordset doesn't hit the database any more, but will still run slower as the report is reading through the data more often.
 
I realize that these solutions are not available to you now, just thoughts for the future
 
HTH
IP IP Logged
Irineas
Newbie
Newbie
Avatar

Joined: 04 Aug 2010
Online Status: Offline
Posts: 4
Quote Irineas Replybullet Posted: 22 Feb 2011 at 6:25am
Hi Lockwell
 
The data is received of an Excel sheet that contains the data mined from a distanced database.
And yes,  i also did thought about a subreport,  but indeed, it slows down to much.
Now i have made the workaround as such that the min is shown in the header per group, (a group is a day) and the max in footer.
That just works fine and satisfied the customer in this case.
Thanks again for the efford.
 
Wisdom is not inhereted, its gained thru experiance and does naturally grow with age.
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.031 seconds.