I have a table with bunch of information (date, time, number of users, database name, etc). This table is updated every 5 mintues.
I am creating a report to summarize this information. During the day, number of users that are on the system will vary depending on the time of day, so in my report, I just want to show the maximum number of users that were logged on the database and the time it happened and the date it happened on. Since this task is put in Job Schedular, it is run every 5 minutes. The problem i am facing: lets say at 11:30am, total number of users that are logged on to system are 25 (maximum of the whole day) and few hours later; lets say 2:35pm the total number of users that are logged on are again 25. This code will display the maximum number of users as 25 (which is correct), but it will display this information twice since it happened at 11:30 and 2:35. Having this redundant information over and over again on the report is pointless.
This what I have so far: Its in OnAfterGetRecrord of the dataitem
MaximumUsers is a int variable that i created.
IF MaximumUsers < "Users Logged On"."Current Users" then THEN
MaximumUsers := "Users Logged On"."Current Users";
Time := "Users Logged On".Time;
Date := "Users Logged On".Date;
I also tried doing this to eliminate the repetitivness of the report (this does get rid of the repetitiveness, but it creates a whole new can of worms to deal with):
IF (MaximumUsers = "Users Logged On"."Current Users") THEN //OR (Date = "Users Logged On".Date) THEN
CurrReport.SKIP
ELSE
MaximumUsers := "Users Logged On"."Current Users";
Time := "Users Logged On".Time;
Date := "Users Logged On".Date;
For the whole day I just want to show one entry which will display the max number of users, date and time it happened for each date. Is there a way to break the table down so that it looks at the date first and goes through all the records for that date and find the max number of users that were on, and then it moves on to the next date and read all the records and find the maximum and displays this info on the report and so on. I was thinking that grouping might work, but then i realize that it wont work al grouping will do is put all the similar dates together....
Any suggestions???
Answers
KCP Consultores
I tried doing it by the footer method that you suggested. But its only showing one entry. Its not considering an entry for every date.
KCP Consultores
Whomever you show it to can see clearly what's going on & when.
See pic for example.
http://www.BiloBeauty.com
http://www.autismspeaks.org
http://www.BiloBeauty.com
http://www.autismspeaks.org
Try here:
http://www.mibuso.com/forum/viewtopic.php?f=23&t=28843
KCP Consultores
Screen shot of everything:
http://www2.zshare.ma/rla8owplm0yo
Screen shot of Preview Report:
http://www2.zshare.ma/2famcbgpf2u7
any idea what I might be missing???
KCP Consultores
I tried doing: "users logged on".setrange("Current Users", maximumusers);
This statements gets me the correct time, but it only runs once...which is pretty obvious...is there a way to get the correct time ( for the max users on the system) and then do a un-setrange ( i know that no such thing exists) or something like that...I was trying to think of a way of using find...but i couldnt come up with anything.
Any suggestions??
KCP Consultores
KCP Consultores
I learned something new today... 8)
If you really want Time displayed to the user then name the field something like Recorded Time but make the caption Time.
KCP Consultores