hexagon logo

Save reports in PDF automatically and use date and time as name

Hi,

I want to save the reports automatically after every run and use date and time for the name file. How I can do that?

Thanks!
  • 131 / 5000 Resultados de traducción

    you need to use variables and the print command. with that you can put the name and self-printing as you require

    example:

    ASSIGN/V1=GETTRACEVALUE("SET")
    ASSIGN/V2=GETTRACEVALUE("ORIGEN")
    ASSIGN/V3=GETTRACEVALUE("CLIENTE")
    ASSIGN/V4=GETTRACEVALUE("NUM")
    ASSIGN/V5=GETPROGRAMINFO("PARTNAME")
    ASSIGN/DAT=SYSTEMDATE("dd_MM_yy")
    ASSIGN/TIM=SYSTEMTIME("hh_mm_ss")
    ASSIGN/FILENAME=V5+"_"+V3+"_"+"Pieza_Num_"+V4+"_SET_"+V1+ "_MEDIDA_EL_"+DAT+"_A_LAS_"+TIM+".pdf"
    ASSIGN/PATH="C:\\USERS\\CMM\\DESKTOP\\Costumer\\REPORTES\"+F ILENAME
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=PATH,AUTO OPEN=OFF,$
    TO_PRINTER=OFF,COPIES=1,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
    TO_EXCEL=OFF,$
    PREVIOUS_RUNS=DELETE_INSTANCES
  • I do my pdf output like this..take stuff out that you don't want to suit your needs

    
    GROUP_PRINT_COMMANDS=GROUP/SHOWALLPARAMS=YES
    ASSIGN/NUMOOT=GETPROGRAMINFO("NUMOOT")
    ASSIGN/PROG_NAME=GETPROGRAMINFO ("PARTNAME")
    ASSIGN/DATE=STR(SYSTEMDATE ("dMMMyyyy"))
    ASSIGN/TIME=STR(SYSTEMTIME ("HHmmss"))
    ASSIGN/REJECT="____REJECT____"
    IF/NUMOOT=="0"
    ASSIGN/REPORT_NAME="O:\\CMM PROGRAMS\\CMM_PDF_PC DMIS\\AG0OFFLINETEST\\"+PROG_NAME+"__"+VAR_SERIAL_ NUMBER+"__"+VAR_RUNNUMBER+"__"+DATE+"__"+TIME+"__. PDF"
    END_IF/
    ELSE/
    ASSIGN/REPORT_NAME="O:\\CMM PROGRAMS\\CMM_PDF_PC DMIS\\AG0OFFLINETEST\\"+PROG_NAME+"__"+VAR_SERIAL_ NUMBER+"__"+VAR_RUNNUMBER+"__"+DATE+"__"+TIME+"__" +REJECT+".PDF"
    END_ELSE/
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,AUTO=1,AUTO OPEN=OFF,$
    TO_PRINTER=OFF,COPIES=1,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME= REPORT_NAME,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
    TO_EXCEL=OFF,$
    PREVIOUS_RUNS=KEEP_INSTANCES
    ENDGROUP/ID=GROUP_PRINT_COMMANDS
    


    Operator sees this..they only open it & print it out if its bad (which the can see from the title)
  • I do my pdf output like this..take stuff out that you don't want to suit your needs

    
    GROUP_PRINT_COMMANDS=GROUP/SHOWALLPARAMS=YES
    ASSIGN/NUMOOT=GETPROGRAMINFO("NUMOOT")
    ASSIGN/PROG_NAME=GETPROGRAMINFO ("PARTNAME")
    ASSIGN/DATE=STR(SYSTEMDATE ("dMMMyyyy"))
    ASSIGN/TIME=STR(SYSTEMTIME ("HHmmss"))
    ASSIGN/REJECT="____REJECT____"
    IF/NUMOOT=="0"
    ASSIGN/REPORT_NAME="O:\\CMM PROGRAMS\\CMM_PDF_PC DMIS\\AG0OFFLINETEST\\"+PROG_NAME+"__"+VAR_SERIAL_ NUMBER+"__"+VAR_RUNNUMBER+"__"+DATE+"__"+TIME+"__. PDF"
    END_IF/
    ELSE/
    ASSIGN/REPORT_NAME="O:\\CMM PROGRAMS\\CMM_PDF_PC DMIS\\AG0OFFLINETEST\\"+PROG_NAME+"__"+VAR_SERIAL_ NUMBER+"__"+VAR_RUNNUMBER+"__"+DATE+"__"+TIME+"__" +REJECT+".PDF"
    END_ELSE/
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,AUTO=1,AUTO OPEN=OFF,$
    TO_PRINTER=OFF,COPIES=1,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME= REPORT_NAME,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
    TO_EXCEL=OFF,$
    PREVIOUS_RUNS=KEEP_INSTANCES
    ENDGROUP/ID=GROUP_PRINT_COMMANDS
    


    Operator sees this..they only open it & print it out if its bad (which the can see from the title)

    {"alt":"Click image for larger version Name:\tpicgrp.jpg Views:\t8 Size:\t19.8 KB ID:\t487248","data-align":"none","data-attachmentid":"487248","data-size":"full"}


    I like how you use the NUMOOT to signify on the report whether the part passed inspection or not.

    Clever!


  • I like how you use the NUMOOT to signify on the report whether the part passed inspection or not.

    Clever!


    Thanks!

    It was fun to get this to work with a DO LOOP ! SunglassesAlien
  • ,
    Here is my code:

    ASSIGN/NUMOOT=GETPROGRAMINFO("NUMOOT")
    ASSIGN/DATE=STR(SYSTEMDATE ("yyyyMMdd"))
    ASSIGN/TIME=STR(SYSTEMTIME ("HHmmss"))
    IF/NUMOOT=="0"
    ASSIGN/REPORT_NAME="\\\server01\\CMM_REPORTS\\PART_"+DATE+TIME+"_PASS.PDF"
    END_IF/
    ELSE/
    ASSIGN/REPORT_NAME="\\\server01\\CMM_REPORTS\\PART_""+DATE+TIME+"_FAIL.PDF"
    END_ELSE/
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=REPORT_NAME,AUTO OPEN=OFF,$
    TO_PRINTER=OFF,COPIES=1,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME= REPORT_NAME,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
    TO_EXCEL=OFF,$
    PREVIOUS_RUNS=KEEP_INSTANCES

    The problem now is that is not saving the file but is printing automatically.

    It's there any option that I need to turn off?

  • Go to File/Printing/Report Window Print Setup, under output options UNCHECK the box that says "Printer".
  • I uncheck the box but doesn't works. Report windows appears empty and do not save any file. If I remove the "PRINT/REPORT" command the report appears as always in the Report Windows.

    I tried the DMIS Output file (TO_DMIS_REPORT=ON) to test the path and work fine.

    Do you have any other suggestion?
  • I'm not sure if your print command is working exactly how you think it is... I have been doing some testing and it appears that if you set the argument after TO_FILE to AUTO, then the .PDF will appear in the measurement routine folder regardless of what is in the FILENAME field. The FILENAME field next to TO_DMIS_REPORT only sets the path if you are saving a .DMO file.

    If you truly wish for the .PDF report to appear in a specified path, you need to set the argument after TO_FILE to either APPEND or OVERWRITE. Doing so, you can specify your variable path after the APPEND or OVERWRITE (e.g. APPEND = "C:\\TEST\\REPORTS\" + var1 + ".PDF").

    This may help you .

    Furthermore, when you do this, the report does not appear in the Report Window after saving to .PDF. To fix this, add a REPORT/TEMPLATE command after the PRINT command and specify the report template that you'd like to appear in the Report Window (e.g. TextOnly.rtp).
  • Thanks . I will try the REPORT/TEMPLATE command and let you know.
  • What is the program info for revision number?

    I've tried

    REVISIONNUMBER
    REVISION_NUMBER
    REVISION NUMBER
    REVNUMBER
    REV_NUMBER
    REV NUMBER
    REVNUM
    REV_NUM
    REV NUM