Excel Filter On Table Columns

forum.sourcecode (2000-2005) & forum.td.sourcecode (2005-2010)
Michael Moretti

Excel Filter On Table Columns

Post by Michael Moretti » 10 Oct 2007, 02:44

 Posted by:  mmoretti@australianvolunteers.com 

Hi All

Is it possible to create a table column that allows you to filter a set of
results, just like the filter function works in excel?
If so, could anyone provide an example?

Thanks
Michael

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2370
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: Excel Filter On Table Columns

Post by Jeff Luther » 10 Oct 2007, 02:59

 Posted by:  Jeff Luther 

I guess I never ran across an Excel filter, but with the TW you could,
*assuming* Discardable=No and Max Rows= for your
TW, so all rows are in cache, do the following:
Set nRow = TBL_MinRow
While SalTblSetContext( hWndTbl, nRow )
! want to total the values for your column?
! want to apply your filter on your colXXX for this nRow?
Set nRow = nRow+1
! Gone through all the rows, now apply your filter to some sum or result
for all the rows?

And that will loop through all the rows. Now, the only questions are:
How to you want to define "set of results" and what filter do you want
to apply to that set??

Best Regards,
Jeff @ PC Design
info. & samples: www.JeffLuther.net/gupta/

Martin Duty

Re: Excel Filter On Table Columns

Post by Martin Duty » 10 Oct 2007, 15:15

 Posted by:  Martin Duty 

Jeff,

Filtering in Excel is changing all the cells in a selected row (usually row
1) into drop downs. These are populated with a list of each unique entry in
that column. Selecting one of the entries then hides all rows that don't
match the selected unique entry. I've added a JPG that shows what I think he
is talking about. Of course the Custom selection allows you to get very
complicated filters.

Michael,

I have not seen anything like that posted in the forums. I think it could be
done, but would require a hell of a lot of coding. I would think it would be
easier to sub-class an Excel sheet on to a form. Then use ActiveX to read
and write data back and forth to it.

This might be possible (and easier) in MTable, but I do not know that
software. Would need to hear from the author.

Martin

You do not have the required permissions to view the files attached to this post.

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2370
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: Excel Filter On Table Columns

Post by Jeff Luther » 10 Oct 2007, 23:01

 Posted by:  Jeff Luther 

Thanks for the "filter" definition, Martin! I haven't seen anything like
this posted in the NG either, and it perhaps would be easier in MTable?
but I don't know it either.

Michael: No sample, but I too think it could be done in SAL alone.

- Jeff

Michael Moretti

Re: Excel Filter On Table Columns

Post by Michael Moretti » 11 Oct 2007, 00:51

 Posted by:  mmoretti@australianvolunteers.com 

Thanks for the responses. I was hoping this had been done before, so
think i'll leave the filtering to excel
Cheers
Michael

Thomas Lauzi

Re: Excel Filter On Table Columns

Post by Thomas Lauzi » 11 Oct 2007, 10:02

 Posted by:  Thomas Lauzi 

Hi Martin,

such a filter could be done, but not with buttons and comboboxes, but on a
contextmenu on the column header.
ROW_Flag_User1..5 could be used for filtering, so that up to 5 filters could
be applied at the same time.

Regards
Thomas L.

Return to “td.sourcecode”

Who is online

Users browsing this forum: [Ccbot] and 0 guests