hexagon logo

Serialize pdf's

I need to have the pdf printed at the end of the run of a program serialized to a specific serial number input via an operator comment at the beginning of the run of the program. Any thoughts?

I am running PC-DMIS 2010 but anything that works from PC-DMIS 3.2063 up to PC-DMIS 2010 should work.

Thanks for any help you folks can provide. This place is a great resource for us new guys.
Parents
  • Hi James,
    This may work for you.

    C1 =COMMENT/INPUT,YES,'Batch No.'
    C2 =COMMENT/INPUT,YES,'Serial No.'



    ASSIGN/COUNTER = 0
    ASSIGN/STEPS = 100
    START_LOOP =LABEL/
    ASSIGN/FNAME = "\\"+PDF_FNAME+"_" + C1.INPUT + "_" + C2.INPUT + "_" + COUNTER + ".PDF"
    V1 =FILE/EXISTS,FNAME
    IF/V1<>0
    ASSIGN/COUNTER = COUNTER + 1
    IF/COUNTER==STEPS
    C1 =COMMENT/YESNO,YES, do you want to overwrite file
    IF/C1.INPUT=="YES"
    ASSIGN/FNAME = "\\"+PDF_FNAME+"_" + C1.INPUT + "_" + C2.INPUT + "_" + COUNTER + ".PDF"
    COMMENT/REPT,"File saved as =_" + (FNAME)
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=C:\RESULTS\TMP1.PDF,$
    TO_PRINTER=OFF,DRAFTMODE=OFF,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
    PREVIOUS_RUNS=DELETE_INSTANCES
    FILE/COPY,C:\RESULTS\TMP1.PDF,FNAME,OVERWRITE
    GOTO/ENDOFFILE
    END_IF/
    IF/C1.INPUT=="NO"
    GOTO/ENDOFFILE
    END_IF/
    END_IF/
    GOTO/START_LOOP
    END_IF/
    END_LOOP =LABEL/
    COMMENT/REPT,"File saved as =_" + (FNAME)
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=C:\RESULTS\TMP1.PDF,$
    TO_PRINTER=OFF,DRAFTMODE=OFF,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
    PREVIOUS_RUNS=DELETE_INSTANCES
    FILE/COPY,C:\RESULTS\TMP1.PDF,FNAME,OVERWRITE
    ENDOFFILE =LABEL/
Reply
  • Hi James,
    This may work for you.

    C1 =COMMENT/INPUT,YES,'Batch No.'
    C2 =COMMENT/INPUT,YES,'Serial No.'



    ASSIGN/COUNTER = 0
    ASSIGN/STEPS = 100
    START_LOOP =LABEL/
    ASSIGN/FNAME = "\\"+PDF_FNAME+"_" + C1.INPUT + "_" + C2.INPUT + "_" + COUNTER + ".PDF"
    V1 =FILE/EXISTS,FNAME
    IF/V1<>0
    ASSIGN/COUNTER = COUNTER + 1
    IF/COUNTER==STEPS
    C1 =COMMENT/YESNO,YES, do you want to overwrite file
    IF/C1.INPUT=="YES"
    ASSIGN/FNAME = "\\"+PDF_FNAME+"_" + C1.INPUT + "_" + C2.INPUT + "_" + COUNTER + ".PDF"
    COMMENT/REPT,"File saved as =_" + (FNAME)
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=C:\RESULTS\TMP1.PDF,$
    TO_PRINTER=OFF,DRAFTMODE=OFF,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
    PREVIOUS_RUNS=DELETE_INSTANCES
    FILE/COPY,C:\RESULTS\TMP1.PDF,FNAME,OVERWRITE
    GOTO/ENDOFFILE
    END_IF/
    IF/C1.INPUT=="NO"
    GOTO/ENDOFFILE
    END_IF/
    END_IF/
    GOTO/START_LOOP
    END_IF/
    END_LOOP =LABEL/
    COMMENT/REPT,"File saved as =_" + (FNAME)
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=C:\RESULTS\TMP1.PDF,$
    TO_PRINTER=OFF,DRAFTMODE=OFF,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
    PREVIOUS_RUNS=DELETE_INSTANCES
    FILE/COPY,C:\RESULTS\TMP1.PDF,FNAME,OVERWRITE
    ENDOFFILE =LABEL/
Children
No Data