How to Filter data reports in fastreport 2.5?

Jose John Smith
Jose John Smith used Ask the Experts™
on
Im not a programmer so please bear with me.... i need help filtering time in my report...

the code the im using is
[rmdAttAbnormite."StartTime"]

the result shows all the time from 7:30 to 8:00 and 12:30 to 13:00 now i want to only show the time range from 7:30 to 8:00 ..anyone please help... thanks
8.png
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Geert GOracle dba
Top Expert 2009

Commented:
it's always better to filter data at the query level

i see a lot of report writers like this:
select * from table

Open in new window


and then filter the results in the report:
order = active 

Open in new window


when they complain the report is slow, i give them this example
> please fetch all the bottles of water from the biggest supermarket in the area
when you come back, i only need 1 bottle, but it's nice to let you do some useless carrying
 
they usually respond with :" are you crazy ?"
i answer "no, but that's exactly what your report is doing ... "

change the query of the report.
the syntax will depend on your database type, which you forgot to mention

on oracle the filter in the query for data from today between 07:30 and 08:00 would be

select * from yourtable
where datefield between trunc(sysdate)+15/48 and trunc(sysdate)+8/24

Open in new window

Ferruccio AccalaiSenior developer, analyst and customer assistance

Commented:
I agree with Geert, anyway are you working at Delphi level or have you  just the FastReport Editor?
In first case you should code a different select at query level as suggested by Geert, but in FR Editor you have to change the values for EndTime too that I guess could be
SetRange(['8:00','13:00'])

Open in new window

To change the Range in StartTime and EndTime,
just from head, you could do something like
[rmdAttAbnormite."StartTime"]
rmdAttAbnormite.SetRange(['7:30','7:30')]
[rmdAttAbnormite."EndTime"]
rmdAttAbnormite.SetRange(['8:00','8:00')]

Open in new window

Author

Commented:
Thanks both of you.......i am working on fastreport editor, i dont know how to filter it on the query level since the report can be accessed through Attendance Management Program 4.8 and i am only changing the codes and design of the report using the built-in fastreport designer from attendance management program.
ill feedback later on with both of your codes
Should you be charging more for IT Services?

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
the codes are not working....mmmmm anyway i would like to show you how i want my report should look like..ill attach a screenshot.
oh and i believe the database im using is access which is in .mdb.
civil.png
Ferruccio AccalaiSenior developer, analyst and customer assistance

Commented:
Without inputs about the database and the code it's really difficult. Just show the StartTime and EndTime properties of the actual report and let's see how could we change them to let you extract the needed timing

Author

Commented:
here's the database of the report....and what do you mean by actual report? the report  i already modified or the default report?
att2000.mdb
9.png

Author

Commented:
and this is the data source named rmdAttAbnormite i am using for the report i am working....Clock In is captioned as StartTime and Clock Out is captioned as EndTime btw.

Edit: cant attach the screenshot, i'll upload it later sorry.
Geert GOracle dba
Top Expert 2009

Commented:
yikes, that's access !!!
you are in the Delphi zone
Ferruccio AccalaiSenior developer, analyst and customer assistance

Commented:
I mean the EndTime property in the Text Editor,
Anyway your mdb doesn't contain any query, so I guess that any kind of filter/query/selection is done at application level.
As you said you're not a programmer you have to work at Fastreport Editor level
Post a screenshot for the EndTime too as you've done above for the StartTime (8.jpg)

Author

Commented:
here's the screenshot for EndTime.
i also added the screenshot of preview for the code im using [rmdAttAbnormite."StartTime"] and this one in the second column [rmdAttAbnormite."EndTime"]
12.png
13.png
Ferruccio AccalaiSenior developer, analyst and customer assistance

Commented:
Let's go a little back.
Here 8.jpg I can see the StartTime property from the first report you've posted. There's also a EndTime property in that report and I'd like to see that one to understand how is declared the delay between start and stop to change it as you asked first

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial