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.
  • $$ NO,
                =====
                =====
                ASSIGN/DATE=SYSTEMDATE("ddMMMyyyy")
                ASSIGN/TIME=SYSTEMTIME("HH:mm")
                ASSIGN/[B][I][COLOR="#FF0000"]PDFNAME[/COLOR][/I][/B]="K:\Folder1\Folder2\Folder3\\"+"PartName_"+JOB+"_"+SERNO+"_CNC_"+CNC+"_Plt_"+PALLET+"_"+DATE+".PDF"
    $$ NO,
                =====
                PRINT/REPORT,EXEC MODE=END,$
                  TO_FILE=ON,OVERWRITE=PDFNAME,$
                  TO_PRINTER=OFF,$
                  TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME=,$
                  REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                  PREVIOUS_RUNS=KEEP_INSTANCES


    As you can see this is our code to create and save our pdfs. Is there a way to use the variable (in red) in the script to open that pdf? This is exactly what I need.

    So it would run part, create and save report, and then open the report it just created.
  • $$ NO,====================================================
         ,End of Program, Save and Report Functions
         ,====================================================
    $$ NO,====================================================
         ,Change nam to "Customer\\Part Reference #\\"
         ,====================================================
                ASSIGN/RTIME=SYSTEMTIME("HHmm")
                ASSIGN/DATE=SYSTEMDATE("MMddyyyy")
                ASSIGN/INFO="_"+DATE+"_"+RTIME+"_"+OPERATOR+"-"+SHIFT+"_"+JOB+"_"+SAMP+"_"
                ASSIGN/NAM="Default\\" 
                [COLOR=#ff0000][B]ASSIGN/NAME=CMMPROGRAM+INFO+".PDF"
    [/B][/COLOR]$$ NO,====================================================
         ,Verify RPTPath is to the appropiate location
         ,====================================================
                ASSIGN/DEFAULTPATH="W:\\Quality\\CMM Reports\\"
                [B][COLOR=#ff0000]ASSIGN/RPTPATH=DEFAULTPATH + NAM
    [/COLOR][/B]$$ NO,====================================================
         ,Refresh Report screen after Execution Finished
         ,====================================================
    Refresh_Report2=SCRIPT/FILENAME= C:\PC-DMIS\4_3\BASIC SCRIPTS\REPORT REFRESH.BAS
                FUNCTION/Main,SHOW=NO,,
                STARTSCRIPT/
    $$ NO,====================================================
         ,Print confirmation, YES/NO
         ,====================================================
    PRINT/REPORT,EXEC MODE=END,$
                  TO_FILE=ON,APPEND=[B][COLOR=#ff0000]RPTPATH+NAME[/COLOR][/B],$
                  TO_PRINTER=ON,$
                  TO_DMIS_REPORT=OFF,FILE_OPTION=APPEND,FILENAME=,$
                  REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                  PREVIOUS_RUNS=KEEP_INSTANCES
    
    PDF_VIEW   =SCRIPT/FILENAME= C:\PC-DMIS\4_3\BASIC SCRIPTS\PDF VIEW AFTER EXECUTE.BAS
                FUNCTION/Main,SHOW=NO,[B][COLOR=#ff0000]ARG1=STR(RPTPATH+NAME[/COLOR][COLOR=#ff0000]),,
    [/COLOR][/B]
    Sub[SIZE=2][COLOR=#000000] Main(strFileName [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#000000])[/COLOR]
    [/SIZE][SIZE=2][COLOR=#007f00][SIZE=2][COLOR=#007f00]'assign ARG1=STR(RPTPATH+Name) In script Line after SHOW=YES
    [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]Shell "C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe " & strFileName
    [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Sub
    
    [/COLOR][/SIZE][/COLOR][/SIZE]


    ^ This is my method.

    So to answer your question, yes. Just change out the "Variable" being called out. In my instance it is RPTPATH+NAME, in yours it would just be PDFNAME.

    
    PRINT/REPORT,EXEC MODE=END,$
                  TO_FILE=ON,APPEND=[B]PDFNAME[/B],$
                  TO_PRINTER=ON,$
                  TO_DMIS_REPORT=OFF,FILE_OPTION=APPEND,FILENAME=,$
                  REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                  PREVIOUS_RUNS=KEEP_INSTANCES
    
    PDF_VIEW   =SCRIPT/FILENAME= C:\PC-DMIS\4_3\BASIC SCRIPTS\PDF VIEW AFTER EXECUTE.BAS
                FUNCTION/Main,SHOW=NO,
    [COLOR=#000000][SIZE=2][B]ARG1=STR([/B]
    [/COLOR] PDFNAME ),,

    Sub Main(strFileName AsString)
    'assign ARG1=STR(PDFNAME) In script Line after SHOW
    Shell "C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe " & strFileName
    EndSub

    [/code]

    that is what yours would look like^. Idk why the forum is acting like this but it keeps adding a
    in my lines.
    [/SIZE]
  • Having an issue with the script. Here is what it looks like:

    Sub Main(strFileName As String)
    Shell "C:\Program Files\Tracker Software\PDF Viewer\PDFXCview.exe " & strFileName
    End Sub


    This is the error:

    "Syntax Error on line: 4-_"

    Any thoughts???? There is nothing on line 4, seems weird to me. But then again, I'm no expert at this.

    ** UPDATE!! **

    Got the errors to go away. Script works, partially. I run the program, it creates the PDF, the PDF viewer opens, but the specific PDF that was just created does not open at all.

    Not sure what the deal is. Thanks.
  • what I do, I simply have a prompt at the end of the run that says "Press cancel to review report before printing". I have a layout saved that is a full screen report, we then review the report. look for bad measurements or double check anything that is out then press the print button and print it out. like this :

    CS2        =SCRIPT/FILENAME= S:\PC-DMIS PROGRAMS\PC-DMIS BASIC SCRIPTS\SAVEAS.BAS
                FUNCTION/Main,SHOW=YES,,
                STARTSCRIPT/
                COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                Press Cancel to Review Report before Printing
                Press OK to Print


    the CS2 script will back up the program run to the server before anyone sees anything, it changes the program name to include Job # Date and whatever serialization we type in in the begining and then changes it back to the original name, that way every run is saved wit a unique name.
  • ** Back to It **

    Enclosed is my program code for creating the report. That part works awesome.
    $$ NO,
                =====
                =====
                ASSIGN/DATE=SYSTEMDATE("ddMMMyyyy")
                ASSIGN/TIME=SYSTEMTIME("HH:mm")
                ASSIGN/PDFNAME="K:\TMTCMM\C27_VBlock_CMM_Reports\\PDF_Test_"+TIME+"_"+DATE+".PDF"
    $$ NO,
                =====
                PRINT/REPORT,EXEC MODE=END,$
                  TO_FILE=ON,OVERWRITE=PDFNAME,$
                  TO_PRINTER=OFF,$
                  TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME=,$
                  REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                  PREVIOUS_RUNS=KEEP_INSTANCES


    This is my script code:
    Sub Main(strFileName As String)
    Shell "C:\Program Files\Tracker Software\PDF Viewer\PDFXCview.exe " & strFileName
    End Sub


    This is my program code to run the script and open the just created PDF
    CS1        =SCRIPT/FILENAME= C:\USERS\KUGLEJD\DESKTOP\PDF_VIEW.BAS
                FUNCTION/Main,SHOW=NO,[COLOR="#FF0000"]ARG1=STR(PDFNAME),[/COLOR],
                STARTSCRIPT/



    After all that, the PDF Viewer does open, just not the specific report for the part that was just run. Any and all help would be GREATLY appreciated.

    I think my issue is with the script and/or the code to run the script (part in RED).
  • "K: \TMTCMM \C27_VBlock_CMM_Reports \\PDF_Test_"+TIME+"_"+DATE+".PDF"

    look at your backslashes.
  • Not sure what you mean. That portion of the program works just fine.

    Apologies for having to be spoon-fed, scripts are not my cup of tea.
  • 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??
  • i turn off the auto print at end ,review each report add comments if required / report to network then transfer a copy to the part folder. just my 2 cents
  • Not exactly what I want. Need to make it automated and idiot proof.