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
  • $$ 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]
Reply
  • $$ 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]
Children
No Data