Topic: TableGrid Filter

Hello,

I'm here faced with a question that i do not know how to solve.

I have a database that I have two forms, one of them every day i put information on it including the date of that day with datetimepicker,  in another form i have a tablegrid where I have some information of  the other form.

The problem is that every day will be a new line on the form where I have tablegrid, after a year will be 365 lines and so on .. making it difficult to search for a particular day.

What I wonder is if I can group the tablegrid for months of the year,  that if i open for example February 2016 appeared the records that i made this month.

Re: TableGrid Filter

Hi Montenegr0,

As far as I know, there is no way to actually GROUP rows in a tablegrid as you might if you were using EXCEL. 
I think the nearest way to do it would be by applying filters to the tablegrid.  There are quite a few different ways of doing this and maybe your design means one way is better than another for you.

I think I would use calculated fields - so as soon as you create each 'day' record, a calculated field to hold the year and a calculated field to hold the month is automatically generated.  Then you can filter on either YEAR or MONTH or BOTH to only show records in your tablegrid that match your filter criteria.  The code to create the YEAR and the MONTH calculated fields is:
strftime('%Y', date) - for the year
strftime('%m', date) - for the month.

Hope this helps,

Derek.

Re: TableGrid Filter

where do i aplly those filters? can you help me with a little program  example? just something for i better understand.

Re: TableGrid Filter

Montenegr0
All you need is button with action "Search" and DateTimePicker with property Kind=MonthYear

Dmitry.

Re: TableGrid Filter

Hello Montenegr0, Dmitry,
Attached is a little project that shows how to search with a filter using DateTime Picker (Kind=MonthYear) but it is the much the same with any field type.  The script is not necessary for the search - I just use it so the User does not have to press the mouse so much!  (that is why the search buttons are invisible).
I hope this helps.
Derek.

Post's attachments

Attachment icon monthyearfilter.zip 339.72 kb, 472 downloads since 2016-02-22