hexagon logo

Report Pop Up

Would the following even work?

I would like the operator to review the report, insert a comment at the end and the print it to a pdf. Our process is to run a part, read a report after it prints and the program is complete, and then gage any diameters that appear to be out. We need a comment at the end of the report that states the part was gaged. Any thoughts??

I've been playing with a few things but cannot get what I want exactly.

Thanks in advance.

No pressure, but this is HOT.
Parents
  • Revisiting this thread. What I need right now is for the report to be reviewed by the tech BEFORE it gets printed as a PDF to the network. Is there a way to make the report pop up at the end of the program before the print command?

    The dream is for the program to run, have the report pop-up to be reviewed, have a script and or form open to disposition the part, have that info put into the end of the report, then print the report as a PDF to the network.

    No biggie, right??


    John, did you ever get it to open the actual PDF in Adobe after execution?? I started a new process where the PDF saves automatically, but my QE wants it to open the PDF in Adobe after it saves. I managed to get the script to open Adobe, but cannot get Adobe to open the actual file.

    Here is my program at the end in PC-Dmis (i masked the Customer name and part # for privacy concerns):

    END        =GROUP/SHOWALLPARAMS=YES
    SAVE_REPORT  =GROUP/SHOWALLPARAMS=YES
        $$ NO,
                    --------------------------------------------------------
                     UPDATE FOLDERPATH inside of "FOLDERPATH" variable below
                    INSIDE THE QUOTATIONS TO ACTUAL REPORT location
                    (COPY AND PASTE FROM FILE EXPLORER ADDRESS BAR (**IN QUOTATION**)
                    E.G.  "M:\DMR\CMM PROGRAMS\>cust name<\>part num<\REPORTS"
                    --------------------------------------------------------
                    ASSIGN/FOLDERPATH="M:\DMR\EPS CMM PROGRAMS\[customer name hidden]\[part name hidden]\REPORTS"
                    WORKPLANE/ZPLUS
    ASSIGN_FILENAME    =GROUP/SHOWALLPARAMS=YES
          $$ NO,
                      CREATES FILE NAME AND PATH BASED ON INPUTS
                      ASSIGN/MYFOLDER=FOLDERPATH + "\\" + V2
                      ASSIGN/FILE=MYFOLDER + "/" + GETPROGRAMINFO("PARTNAME") + "_" + V2 + "_" + SYSTIME() + "_" + V1 + ".pdf"
                    ENDGROUP/ID=ASSIGN_FILENAME
    CREATE_FOLDER    =GROUP/SHOWALLPARAMS=YES
          $$ NO,
                      --------------------------------------------------------------
                      CREATES THE FOLDER, IF NEEDED.
                      WILL POP UP A WARNING IF FOLDER IS ALREADY CREATED,
                      CLICK OK ON DIALOG BOX TO CONTINUE
                      --------------------------------------------------------------
    CS1              =SCRIPT/FILENAME= "M:\DMR\CMM PROGRAMS\_SCRIPTS\CREATE.BAS"
                      FUNCTION/PCDCreatefolder,SHOW=YES,ARG1=MYFOLDER,,
                      STARTSCRIPT/
                      ENDSCRIPT/
                    ENDGROUP/ID=CREATE_FOLDER
    REDRAW         =GROUP/SHOWALLPARAMS=YES
          $$ NO,
                      Redraws the Report Window before saving.
    CS2              =SCRIPT/FILENAME= "M:\DMR\CMM PROGRAMS\_SCRIPTS\REDRAW.BAS"
                      FUNCTION/Main,SHOW=YES,,
                      STARTSCRIPT/
                      ENDSCRIPT/
                    ENDGROUP/ID=REDRAW
    OUTPUT         =GROUP/SHOWALLPARAMS=YES
                      PRINT/REPORT,EXEC MODE=END,$
                        TO_FILE=ON,OVERWRITE=FILE,AUTO OPEN=ON,$
                        TO_PRINTER=OFF,COPIES=1,$
                        TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME=FILE,$
                        REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                        TO_EXCEL=OFF,$
                        PREVIOUS_RUNS=DELETE_INSTANCES
                    ENDGROUP/ID=OUTPUT
    OPEN_RPT       =SCRIPT/FILENAME= M:\DMR\CMM PROGRAMS\_SCRIPTS\OPEN_REPORT.BAS
                    FUNCTION/Main,SHOW=NO,ARG1=FILE,,
                    STARTSCRIPT/
                  ENDGROUP/ID=SAVE_REPORT
                ENDGROUP/ID=END​
    


    the Create Folder script:

    '
    Sub PCDCreateFolder(MyFolder As String)
    
        Dim MyFileSysObj, f
        
        Set MyFileSysObj = CreateObject("Scripting.FileSystemObject")
    
        If Not MyFileSysObj.FolderExists(MyFolder) Then
            Set f = MyFileSysObj.CreateFolder(MyFolder)
        Else
            MsgBox MyFolder & " already exists!", vbExclamation, "PCDCreateFolder"
        End If
    
    End Sub
    ​


    The Redraw Report Script:

    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​
    


    And, lastly, the Open File Script (opens Adobe, but not the file):

    Sub Main ()
    Dim File As String
    Shell "C:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe" & File
    End Sub​
    


    I also have the print command set to open the PDF, but it won't.
    All of these scripts I grabbed off of this forum, so if anyone else wants to use them, feel free to. Just paste the root folder where you want the reports, and it does the work, given the script locations are set, and the CS1, CS2, CS3 commands aren't marked (didn't realize PC-Dmis skips them by default when creating a script reference) Slight smile
Reply
  • Revisiting this thread. What I need right now is for the report to be reviewed by the tech BEFORE it gets printed as a PDF to the network. Is there a way to make the report pop up at the end of the program before the print command?

    The dream is for the program to run, have the report pop-up to be reviewed, have a script and or form open to disposition the part, have that info put into the end of the report, then print the report as a PDF to the network.

    No biggie, right??


    John, did you ever get it to open the actual PDF in Adobe after execution?? I started a new process where the PDF saves automatically, but my QE wants it to open the PDF in Adobe after it saves. I managed to get the script to open Adobe, but cannot get Adobe to open the actual file.

    Here is my program at the end in PC-Dmis (i masked the Customer name and part # for privacy concerns):

    END        =GROUP/SHOWALLPARAMS=YES
    SAVE_REPORT  =GROUP/SHOWALLPARAMS=YES
        $$ NO,
                    --------------------------------------------------------
                     UPDATE FOLDERPATH inside of "FOLDERPATH" variable below
                    INSIDE THE QUOTATIONS TO ACTUAL REPORT location
                    (COPY AND PASTE FROM FILE EXPLORER ADDRESS BAR (**IN QUOTATION**)
                    E.G.  "M:\DMR\CMM PROGRAMS\>cust name<\>part num<\REPORTS"
                    --------------------------------------------------------
                    ASSIGN/FOLDERPATH="M:\DMR\EPS CMM PROGRAMS\[customer name hidden]\[part name hidden]\REPORTS"
                    WORKPLANE/ZPLUS
    ASSIGN_FILENAME    =GROUP/SHOWALLPARAMS=YES
          $$ NO,
                      CREATES FILE NAME AND PATH BASED ON INPUTS
                      ASSIGN/MYFOLDER=FOLDERPATH + "\\" + V2
                      ASSIGN/FILE=MYFOLDER + "/" + GETPROGRAMINFO("PARTNAME") + "_" + V2 + "_" + SYSTIME() + "_" + V1 + ".pdf"
                    ENDGROUP/ID=ASSIGN_FILENAME
    CREATE_FOLDER    =GROUP/SHOWALLPARAMS=YES
          $$ NO,
                      --------------------------------------------------------------
                      CREATES THE FOLDER, IF NEEDED.
                      WILL POP UP A WARNING IF FOLDER IS ALREADY CREATED,
                      CLICK OK ON DIALOG BOX TO CONTINUE
                      --------------------------------------------------------------
    CS1              =SCRIPT/FILENAME= "M:\DMR\CMM PROGRAMS\_SCRIPTS\CREATE.BAS"
                      FUNCTION/PCDCreatefolder,SHOW=YES,ARG1=MYFOLDER,,
                      STARTSCRIPT/
                      ENDSCRIPT/
                    ENDGROUP/ID=CREATE_FOLDER
    REDRAW         =GROUP/SHOWALLPARAMS=YES
          $$ NO,
                      Redraws the Report Window before saving.
    CS2              =SCRIPT/FILENAME= "M:\DMR\CMM PROGRAMS\_SCRIPTS\REDRAW.BAS"
                      FUNCTION/Main,SHOW=YES,,
                      STARTSCRIPT/
                      ENDSCRIPT/
                    ENDGROUP/ID=REDRAW
    OUTPUT         =GROUP/SHOWALLPARAMS=YES
                      PRINT/REPORT,EXEC MODE=END,$
                        TO_FILE=ON,OVERWRITE=FILE,AUTO OPEN=ON,$
                        TO_PRINTER=OFF,COPIES=1,$
                        TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME=FILE,$
                        REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                        TO_EXCEL=OFF,$
                        PREVIOUS_RUNS=DELETE_INSTANCES
                    ENDGROUP/ID=OUTPUT
    OPEN_RPT       =SCRIPT/FILENAME= M:\DMR\CMM PROGRAMS\_SCRIPTS\OPEN_REPORT.BAS
                    FUNCTION/Main,SHOW=NO,ARG1=FILE,,
                    STARTSCRIPT/
                  ENDGROUP/ID=SAVE_REPORT
                ENDGROUP/ID=END​
    


    the Create Folder script:

    '
    Sub PCDCreateFolder(MyFolder As String)
    
        Dim MyFileSysObj, f
        
        Set MyFileSysObj = CreateObject("Scripting.FileSystemObject")
    
        If Not MyFileSysObj.FolderExists(MyFolder) Then
            Set f = MyFileSysObj.CreateFolder(MyFolder)
        Else
            MsgBox MyFolder & " already exists!", vbExclamation, "PCDCreateFolder"
        End If
    
    End Sub
    ​


    The Redraw Report Script:

    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​
    


    And, lastly, the Open File Script (opens Adobe, but not the file):

    Sub Main ()
    Dim File As String
    Shell "C:\Program Files\Adobe\Acrobat DC\Acrobat\Acrobat.exe" & File
    End Sub​
    


    I also have the print command set to open the PDF, but it won't.
    All of these scripts I grabbed off of this forum, so if anyone else wants to use them, feel free to. Just paste the root folder where you want the reports, and it does the work, given the script locations are set, and the CS1, CS2, CS3 commands aren't marked (didn't realize PC-Dmis skips them by default when creating a script reference) Slight smile
Children
No Data