2 Replies Latest reply: May 15, 2014 9:58 AM by Laker Netman RSS

    Filter change not working in script

    Laker Netman

      I'm running Monarch Pro 7.02.  I have written a script to automate output from a model.  The first portion uses three different models and outputs to three worksheets in the same Excel workbook. This works as expected.

       

      The second part does (rather "should do") essentially the opposite.  It opens a different model which contains several filters. I loop through a list of the filters of interest, setting MonarchObj.CurrentFilter. When I do a JetExportSummary following each filter change the same file is created each time -- it's output being the "active filter definition" saved (and opended by default) in the model, rather than the selected filter.  It's like it's just being ignored. I have confirmed in the "immediate window" and via code the .CurrentFilter property is being changed and the result from JetExportSummary is true, indicating success.

       

      Am I missing a step?  Is there something I need to do to regenerate the summary based on the changed filter?  I thought JetExportSummmary would be sufficient.

       

      TIA, Laker

        • Filter change not working in script
          RalphB _

          Welcome to the forum Laker,

           

          What filter are you applying to your summary?  You can check that on the General tab of the Summary Definitions tab.  Make sure the "Apply Filter" is set to "Default Filter" or else your summary will always use that filter you have assigned.  The "Default Filter" setting will always use whatever filter you have applied to the table.

           

          Whenever I need to apply multiple filters to summaries thru script, I always make sure that I have the default filter set in the summary or I will have multiple summaries set to apply a certain filter for that summary that I need.

           

          Hope this helps.

          • Filter change not working in script
            Laker Netman

            Thank you!  That was the exact issue. The person who  built the model had set a specific filter, rather than "Default Filter". We switched it to Default and  everything started working as expected.

             

            Thanks again,

              Laker