refresh report screen script?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • refresh report screen script?

    I need a script for refreshing the report screen in ver 4.2. I know very little about scripts, but I saw the script Jan has posted in the sample code forum, and think something very similar could work.
    The way it works now is we have a custom report that we have to cancel the program at the end and then click the refresh button to get it to populate the data(variables) correctly then click on the print icon to print the report. What I would like to do is have a script that refreshes the report at then end and then when the program ends normaly and prints it will have all the data populated correctly.
    thank in advance for any help
    Mike Hesse
    Global FX 7-10-7
    Global Silver 7-10-7
    Microval PFX
    PC-DMIS 2012 mr1

  • #2
    not a bad one to write.

    Code:
    Sub Main()
    
    
    '************PC-DMIS declarations************
    Dim pcdApp As Object
    Set pcdApp = CreateObject("PCDLRN.Application")
    
    Dim pcdPart As Object
    Set pcdPart = pcdApp.ActivePartProgram
    
    Dim pcdReportWindow As Object
    Set pcdReportWindow = pcdPart.ReportWindow
    
    '***********Repaint the report window*********
    pcdReportWindow.RefreshReport
    
    '********************Cleanup**********************
    Set pcdReportWindow = Nothing
    Set pcdPart = Nothing
    Set pcdApp = Nothing
    
    End Sub

    Comment


    • #3
      Great, thanks I'll give this a try
      Thanks Mike
      Global FX 7-10-7
      Global Silver 7-10-7
      Microval PFX
      PC-DMIS 2012 mr1

      Comment


      • #4
        Ok I tried this and I get an error message. I have no clue when it comes to scripting so I have no idea what is wrong, It's probably me. but here is a screen capture and the code from the program to call the script up.



        CS1 =SCRIPT/FILENAME= H:\SCRIPT\REFRESHER.BAS
        FUNCTION/Main,SHOW=YES,,
        STARTSCRIPT/
        ENDSCRIPT/
        Attached Files
        Global FX 7-10-7
        Global Silver 7-10-7
        Microval PFX
        PC-DMIS 2012 mr1

        Comment


        • #5
          I can't see where the error would be.

          Using the block of PC-DMIS code you posted with the bitmap and the script copied and pasted from the board this works.

          Did you change anything in the Script?

          Comment


          • #6
            I didn't change anything, but i have been having other issues and it probably is something I did. I'll have to try it again and see if it works. If it works for you then I know the code is good. I'll try some stuff on my end to get it to work. thanks for checking it out
            Mike
            Global FX 7-10-7
            Global Silver 7-10-7
            Microval PFX
            PC-DMIS 2012 mr1

            Comment


            • #7
              what also might be your prob: you don't have Admin-rights?
              the PCD-basic-script opens with the CreateObject("PCDLRN.Application")-line
              always the last through an Admin opened PCD-version which is stored under:
              "HKEY_CLASSES_ROOT\PCDLRN.Application\CLSID"

              HTH

              Comment


              • #8
                I tested the code and it works fine on my end too.

                You might want to try just running a very simple script that displays a message box to ensure you have the capability to run scripts.

                For example:
                Sub Main()
                MsgBox "If this message appears then scripts work."
                End Sub
                Just paste that inside the Basic Script Editor and see if it works.
                Then tie it to the Pcdmis Script command and see if it works during execution.

                This may help you find what's causing the problem.
                Jared Hess - Techwriter @ WAI
                [View Reporting Tutorials Here]

                Comment


                • #9
                  o.k. i think the script is correct. it runs with out error. Jared may be you can help here. You had helped make my custom report that uses variables to define the item numbers. I was hopeing to run this script at the end of the program to automaticly refresh the report window and updaye all the variables to display correctly.
                  Global FX 7-10-7
                  Global Silver 7-10-7
                  Microval PFX
                  PC-DMIS 2012 mr1

                  Comment


                  • #10
                    So, you were able to get the refresh report script to work on your end? What happens in your final report then when it's executed?
                    Jared Hess - Techwriter @ WAI
                    [View Reporting Tutorials Here]

                    Comment


                    • #11
                      yes the script seems to run but I get nothing to update that I can tell. it is the same as if the program just ended. and to get the Item numbers to update I still need to click the Redraw Icon.
                      Global FX 7-10-7
                      Global Silver 7-10-7
                      Microval PFX
                      PC-DMIS 2012 mr1

                      Comment


                      • #12
                        Hi Mike, I'm not sure what to tell you. In my tests the item number on the modified PPAP template updates the item column to whatever you have given in the ASSIGN statements without needing to refresh it.
                        Jared Hess - Techwriter @ WAI
                        [View Reporting Tutorials Here]

                        Comment


                        • #13
                          Jared it does this on 2 pc's, is there a setting that I could have wrong in the set-up. I would think that they should update, but niether does.
                          Global FX 7-10-7
                          Global Silver 7-10-7
                          Microval PFX
                          PC-DMIS 2012 mr1

                          Comment


                          • #14
                            You might want to ensure that your modified PPAP template is your default template. I don't know if that will fix the problem, but it's worth a shot.
                            Jared Hess - Techwriter @ WAI
                            [View Reporting Tutorials Here]

                            Comment

                            Related Topics

                            Collapse

                            Working...
                            X