4 Replies Latest reply: May 15, 2014 9:59 AM by Nick Osdale-Popa RSS

    Apply Filter To Summary Export

    mclark _

      Isn't it possible to apply a filter to a summary before exporting it?  It appears that the filter is set on .ExportTable but not applied to the .ExportSummary statement.   :confused:  Here is the code:

          

      MonarchObj.SetModelFile"C:mymodel.mod"           MonarchObj.CurrentFilter "MyFilter"

      MonarchObj.CurrentSummary "SumTotals"

      MonarchObj.ExportSummary ("C:myfile.mdb")

      MonarchObj.ExportTable ("C:TestFile.xls")

       

      Any help is appreciated. Thanks

        • Apply Filter To Summary Export
          Grant Perkins

          Hi MC,

           

          Not being a coder I have refrained from answering this but time is passing so ....

           

          Do you have V7?

           

          If so I think you should be able to set the filters by summary and save the model AND the project then load the PROJECT in your code and make use of the PROJECT EXPORT function. (But take care to understand the difference between a 'project' and the 'project export'.)

           

          If not V7 I guess it means going back into the programmer guide - not my area of expertise I'm afraid.

           

          Grant

           

          Originally posted by mclark:

          Isn't it possible to apply a filter to a summary before exporting it?  It appears that the filter is set on .ExportTable but not applied to the .ExportSummary statement.    :confused:   Here is the code:

              

          MonarchObj.SetModelFile"C:mymodel.mod"           MonarchObj.CurrentFilter "MyFilter"

          MonarchObj.CurrentSummary "SumTotals"

          MonarchObj.ExportSummary ("C:myfile.mdb")

          MonarchObj.ExportTable ("C:TestFile.xls")

           

          Any help is appreciated. Thanks /b[/quote]

          • Apply Filter To Summary Export
            mclark _

            Grant thank you for responding. Actually I discovered that if I set the summary to default filter, then the code works.   smile.gif[/img]

            • Apply Filter To Summary Export
              Mark Huston

              Wouldn't you need an equal sign after CurrentFilter? You shouldn't have to settle for the default filter. You can set the CurrentFilter, export, then re-set a different CurrentFilter, then export again, etc.

              [font="courier"] 

              With MonarchObj

                   .SetModelFile "C:mymodel.mod"

                   .CurrentFilter = "MyFilter"

                   .CurrentSummary = "SumTotals"

                   .ExportSummary ("C:myfile.mdb")

                   .ExportTable ("C:TestFile.xls")

              End with[/font][/quote]

              • Apply Filter To Summary Export
                Nick Osdale-Popa

                I just double-checked my code, an "equal sign" is not necessary when setting the .CurrentFilter property. What I do is first set it to the default filter:

                 

                objMonarch.CurrentFilter ""

                 

                Then set it to the filter I want:

                 

                objMonarch.CurrentFilter "MyFilter"