gurusai sankar Posted April 4, 2019 Share Posted April 4, 2019 Hi All, I want to fix the reset all filter except period ranage filter in text area i am using below script, first 3 tabs are working fine but 4th tab (Unmet demand is not working) , i have used the similar script for all. Please find attcahed dxp and help on this. import Spotfire.Dxp.Application.Filters as filters import Spotfire.Dxp.Application.Filters.ListBoxFilter from Spotfire.Dxp.Application.Filters import FilterTypeIdentifiers from Spotfire.Dxp.Data import DataPropertyClass from System import String myPanel = Document.ActivePageReference.FilterPanel #REset Testcolumn form the first table myFilter= myPanel.TableGroups[0].GetFilter("RESOURCE_POOL_REQUESTED") lbFilter = myFilter.FilterReference.As[filters.ListBoxFilter]() lbFilter.IncludeAllValues=False lbFilter.Reset() #REset Testcolumn form the first table myFilter= myPanel.TableGroups[0].GetFilter("ROLENAME") lbFilter = myFilter.FilterReference.As[filters.ListBoxFilter]() lbFilter.IncludeAllValues=False lbFilter.Reset() #REset Testcolumn form the first table myFilter= myPanel.TableGroups[0].GetFilter("PROJECT_NAME") lbFilter = myFilter.FilterReference.As[filters.ListBoxFilter]() lbFilter.IncludeAllValues=False lbFilter.Reset() #REset Testcolumn form the first table myFilter= myPanel.TableGroups[0].GetFilter("PROGRAM_NAME") lbFilter = myFilter.FilterReference.As[filters.ListBoxFilter]() lbFilter.IncludeAllValues=False lbFilter.Reset() Link to comment Share on other sites More sharing options...
James Watts Posted April 5, 2019 Share Posted April 5, 2019 You need to change the TableGroups index to 1: myPanel.TableGroups[1].GetFilter("RESOURCE_POOL_REQUESTED") - in all four calls to it. Link to comment Share on other sites More sharing options...
Gaia Paolini Posted April 5, 2019 Share Posted April 5, 2019 You are looking for the filter RESOURCE_POOL_REQUESTED, but this lives in the second table group ofthat page (Information_link_Unment_Demand Month Level). So when you write: myFilter= myPanel.TableGroups[0].GetFilter("RESOURCE_POOL_REQUESTED") the table group you get is the first one appearing on your filter panel (Information_link_MONTHLY_CAPACITY_VIEW) which does not contain that filter and returns None. Workarounds: a) changeTableGroups[0] toTableGroups[1] b) move up the desired table group in your filter panel for the affected page c) write safer code to identify the correct table group and use it throughout, e.g. pageGroups = myPanel.TableGroups for tg in pageGroups: print tg.Name if tg.Name=='Information link_Unment Demand_Month level': myTableGroup=tg #REset Testcolumn form the first table myFilter= myTableGroup.GetFilter("RESOURCE_POOL_REQUESTED") lbFilter = myFilter.FilterReference.As[filters.ListBoxFilter]() lbFilter.IncludeAllValues=False lbFilter.Reset() #..same for the other groups of statements In general, running the Iron Python script within the editor window and putting print statements is a good debugging practice, so you can see where the error occurs and get an idea of the underlying problem. Gaia Link to comment Share on other sites More sharing options...
gurusai sankar Posted April 5, 2019 Author Share Posted April 5, 2019 Thanks a lot for your help, it worked. Link to comment Share on other sites More sharing options...
gurusai sankar Posted April 5, 2019 Author Share Posted April 5, 2019 Thanks a lot for your help Jim it worked. Link to comment Share on other sites More sharing options...
gurusai sankar Posted May 7, 2019 Author Share Posted May 7, 2019 Thanks a lot for your continued help. i have one more query. if possible- kindly help on this. https://community.spotfire.com/questions/how-get-check-and-unchecked-filter-dynamically#node-1078461 Link to comment Share on other sites More sharing options...
gurusai sankar Posted May 7, 2019 Author Share Posted May 7, 2019 Hi Jim,Thanks a lot for your continued help. if possible - kindly help on below query. https://community.spotfire.com/questions/how-get-check-and-unchecked-filter-dynamically#node-1078461 Link to comment Share on other sites More sharing options...
gurusai sankar Posted May 8, 2019 Author Share Posted May 8, 2019 sorry, please ignore above query, it has been done. kindly help on below query . https://community.spotfire.com/questions/how-get-grand-total-value-all-rows-or-else-how-fix-empty-values-all-rows-except-grand Link to comment Share on other sites More sharing options...
gurusai sankar Posted May 8, 2019 Author Share Posted May 8, 2019 Sorry Gaia. please ignore above query. it has been done. kindly help on below query.sorry, please ignore above query, it has been done. kindly help on below query . https://community.spotfire.com/questions/how-get-grand-total-value-all-rows-or-else-how-fix-empty-values-all-rows-except-grand Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now