hexagon logo

Printing reports with serial # as file name.

I output a PDF report for every part I check and I currently use auto indexing to name them. There is a report comment at the beginning of the program that asks for the serial # of the part. I was wondering if it's possible to instead have PC DMIS automatically add that same serial # to the end of the file name instead of the index #. This would be helpful if I need to find the report for a specific piece later. I know I could just manually type it in each time. I'm just looking for a more efficient method since the serial #'s are often over 20 characters and I never remember what it was at the end of the program and I'd rather not take it off the machine before viewing the report in case I need to remeasure something. Am I asking too much here?
Parents
  • Thanks for all the advice, but I think this is now out of my league.


    It is quite simple. If you change the view to command mode momentarily to edit one thing, and then change it back, you will be good.

    Create a new variable with "GETPROGRAMINFO("SERIALNUM")". This will grab the serial number you define in the 'File Header' of the program. I have assigned the name of 'SN' but it can be anything you'd like.

    Then, you'll want to do "Insert -> Report Command -> Print Command"

    You can then edit that to select the correct file location. Select the option "Auto".

    Once done, you will want to switch to command mode if you arent already in command mode. You should see the assign and print commands. Under the print command you will want to change part of the second line from "AUTO=1" to "AUTO=SN". This should then automatically add the serial number on to the end of the file name each time.

    Hope this helps more than my previous response. Below is a snip of the code.

    ASSIGN/SN=GETPROGRAMINFO("SERIALNUM")
                PRINT/REPORT,EXEC MODE=END,$
                  TO_FILE=ON,AUTO=SN,OUTPUT_FORMAT/PDF,$
                  RESET_REPORT=YES,AUTO OPEN=OFF,$
                  TO_PRINTER=OFF,COPIES=1,$
                  TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
                  REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                  TO_EXCEL=OFF,$
                  PREVIOUS_RUNS=DELETE_INSTANCES​
Reply
  • Thanks for all the advice, but I think this is now out of my league.


    It is quite simple. If you change the view to command mode momentarily to edit one thing, and then change it back, you will be good.

    Create a new variable with "GETPROGRAMINFO("SERIALNUM")". This will grab the serial number you define in the 'File Header' of the program. I have assigned the name of 'SN' but it can be anything you'd like.

    Then, you'll want to do "Insert -> Report Command -> Print Command"

    You can then edit that to select the correct file location. Select the option "Auto".

    Once done, you will want to switch to command mode if you arent already in command mode. You should see the assign and print commands. Under the print command you will want to change part of the second line from "AUTO=1" to "AUTO=SN". This should then automatically add the serial number on to the end of the file name each time.

    Hope this helps more than my previous response. Below is a snip of the code.

    ASSIGN/SN=GETPROGRAMINFO("SERIALNUM")
                PRINT/REPORT,EXEC MODE=END,$
                  TO_FILE=ON,AUTO=SN,OUTPUT_FORMAT/PDF,$
                  RESET_REPORT=YES,AUTO OPEN=OFF,$
                  TO_PRINTER=OFF,COPIES=1,$
                  TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
                  REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                  TO_EXCEL=OFF,$
                  PREVIOUS_RUNS=DELETE_INSTANCES​
Children
No Data