7 Replies Latest reply: May 15, 2014 9:52 AM by Data Kruncher RSS

    Auto Print Summary

    MorseB _

      I copied working code for printing a summary automatically but it is failing.  I can do the steps manually and the summmary prints correctly.  The summary header prints but the summarized records do not.  There is a line for sum and a hyphen is in the amount column.

       

      For example:

       

      Manually printed -

       

      Report: DAFR8720  Model: Dafr8720.xmod 

      Filter: 8720  Summary: Sum

       

      Type            RunAmount

      Dep             74,061,607.85

      Inv             27,141,684.31

      Sum            101,203,292.16

       

      Automatically printed -

      Type            RunAmount

      Sum                     -

       

       

      The code is pasted below.  You will notice that the original working code is commented out with a leading apostrophe.

       

      Private Sub DAFR8720_Click()

       

          Dim stappname As String

          Dim stDocName As String

          Dim strexists As String

          Dim monarchobj As Object

          Dim openfile, openmod, t As Boolean

       

      'If Monarch is currently active GetObject will use Monarch. If it is not, use the CreateObject() to

      'open another copy of Monarch.

      Set monarchobj = GetObject("", "Monarch32")

      If monarchobj Is Nothing Then

      Set monarchobj = CreateObject("Monarch32")

      End If

       

      t = monarchobj.setlogfile("C:MonTempMPrg_G5.log", False)

       

      'openfile = monarchobj.SetReportFile("Treas_recpt_nt2 ecpt.FTPmainftpDAFR2261", False)

      openfile = monarchobj.SetReportFile("Treas_recpt_nt2 ecpt.FTPmainftpDAFR8720", False)

       

      If openfile = True Then

      'openmod = monarchobj.SetModelFile("Treas_recpt_nt2DReconWinMonarchDafr2261DCCB.xmod")

      openmod = monarchobj.SetModelFile("Treas_recpt_nt2DReconWinMonarchDafr8720.xmod")

       

      If openmod = True Then

      'Set filter

      'monarchobj.CurrentFilter = "TSZP"

      monarchobj.CurrentFilter = "8720"

      'monarchobj.CurrentSummary = "TSZP"

      monarchobj.CurrentSummary = "Sum"

      monarchobj.PrintSummary (True)

       

      'MonarchObj.PrintTable (True)

      End If

       

      End If

       

      monarchobj.CloseAllDocuments

      monarchobj.Exit

       

       

      End Sub

       

       

      Does anyone see something I do not?

       

      Thank you.

        • Auto Print Summary
          MorseB _

          I copied working code for printing a summary automatically but it is failing.  I can do the steps manually and the summmary prints correctly.  The summary header prints but the summarized records do not.  There is a line for sum and a hyphen is in the amount column.

           

          For example:

           

          Manually printed -

           

          Report: DAFR8720  Model: Dafr8720.xmod 

          Filter: 8720  Summary: Sum

           

          Type            RunAmount

          Dep             74,061,607.85

          Inv             27,141,684.31

          Sum            101,203,292.16

           

          Automatically printed -

          Type            RunAmount

          Sum                     -

           

           

          The code is pasted below.  You will notice that the original working code is commented out with a leading apostrophe.

           

          Private Sub DAFR8720_Click()

           

              Dim stappname As String

              Dim stDocName As String

              Dim strexists As String

              Dim monarchobj As Object

              Dim openfile, openmod, t As Boolean

           

          'If Monarch is currently active GetObject will use Monarch. If it is not, use the CreateObject() to

          'open another copy of Monarch.

          Set monarchobj = GetObject("", "Monarch32")

          If monarchobj Is Nothing Then

          Set monarchobj = CreateObject("Monarch32")

          End If

           

          t = monarchobj.setlogfile("C:MonTempMPrg_G5.log", False)

           

          'openfile = monarchobj.SetReportFile("Treas_recpt_nt2 ecpt.FTPmainftpDAFR2261", False)

          openfile = monarchobj.SetReportFile("Treas_recpt_nt2 ecpt.FTPmainftpDAFR8720", False)

           

          If openfile = True Then

          'openmod = monarchobj.SetModelFile("Treas_recpt_nt2DReconWinMonarchDafr2261DCCB.xmod")

          openmod = monarchobj.SetModelFile("Treas_recpt_nt2DReconWinMonarchDafr8720.xmod")

           

          If openmod = True Then

          'Set filter

          'monarchobj.CurrentFilter = "TSZP"

          monarchobj.CurrentFilter = "8720"

          'monarchobj.CurrentSummary = "TSZP"

          monarchobj.CurrentSummary = "Sum"

          monarchobj.PrintSummary (True)

           

          'MonarchObj.PrintTable (True)

          End If

           

          End If

           

          monarchobj.CloseAllDocuments

          monarchobj.Exit

           

           

          End Sub

           

           

          Does anyone see something I do not?

           

          Thank you.

          • Auto Print Summary
            Data Kruncher

            Hi Beth,

             

            Just a couple of ideas to try; nothing jumps out that clearly would not work.

             

            First, is the summary named Sum set to use the current filter, no filter or a specific filter? Can you see the records on the summary screen during the process?

             

            Second, try using an IsServerActive loop to be able to check the Sum summary as set by your program before you CloseAllDocuments and Exit ([url="http://mails.datawatch.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=1;t=000312;p=1#000004"]example[/url]).

            This may help you see what, if anything, that isn't doing what you expect.

             

            HTH,

            Kruncher

            • Auto Print Summary
              Data Kruncher

              Hi Beth,

               

              Just a couple of ideas to try; nothing jumps out that clearly would not work.

               

              First, is the summary named Sum set to use the current filter, no filter or a specific filter? Can you see the records on the summary screen during the process?

               

              Second, try using an IsServerActive loop to be able to check the Sum summary as set by your program before you CloseAllDocuments and Exit ([url="http://mails.datawatch.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=1;t=000312;p=1#000004"]example[/url]).

              This may help you see what, if anything, that isn't doing what you expect.

               

              HTH,

              Kruncher

              • Auto Print Summary
                MorseB _

                First, is the summary named Sum set to use the current filter, no filter or a specific filter?

                 

                Answer: summary named Sum General Tabl Apply Filter = Default Filter.  Same is true for summary named TSZP.

                 

                Can you see the records on the summary screen during the process?

                 

                Answer: No cannot see records on the summary screen.

                • Auto Print Summary
                  MorseB _

                  First, is the summary named Sum set to use the current filter, no filter or a specific filter?

                   

                  Answer: summary named Sum General Tabl Apply Filter = Default Filter.  Same is true for summary named TSZP.

                   

                  Can you see the records on the summary screen during the process?

                   

                  Answer: No cannot see records on the summary screen.

                  • Auto Print Summary
                    Data Kruncher

                    Update:

                     

                    Beth and I worked together outside of the forum to solve this issue. In the end, it came down to a calculated character field used in the filter simply wasn't set quite wide enough. It had both of us looking at many calculations in the model, though. A nice challenge - even better when solved.

                     

                    Thanks for the help you provided in resolving this Beth!

                     

                    Kruncher

                    • Auto Print Summary
                      Data Kruncher

                      Update:

                       

                      Beth and I worked together outside of the forum to solve this issue. In the end, it came down to a calculated character field used in the filter simply wasn't set quite wide enough. It had both of us looking at many calculations in the model, though. A nice challenge - even better when solved.

                       

                      Thanks for the help you provided in resolving this Beth!

                       

                      Kruncher