hexagon logo

Dynamic Variable on Report

Hello. I'm looking to get some insight into this request and see if it is even possible.

The basic idea of what I want to try and do is add two variables to my report. These variables would be the location of the report and the user who is logged in to the computer.

So, when we save reports, everything is sorted by part number and then lot number. (example: \part123\lot456\date.pdf) If that is the save location defend in the report window print setup, is there anyway to get the "lot456" input as a variable in the header, only by defining the path in the report print setup? See example picture for reference.

The second thing I would like to do is add the have the currently logged in windows user show on the report. Ideally the display name but if only the username is possible, that is fine too.

Any help would be much appreciated. Thanks!

Parents
  • ASSIGN/FILEPDF="C:\Users\tmoconno\Desktop\test\\"+lot_var+"\"+date_var+".pdf"
                  PRINT/REPORT,EXEC MODE=END,$
                    TO_FILE=ON,OVERWRITE=FILEPDF,AUTO OPEN=OFF,$
                    TO_PRINTER=OFF,COPIES=1,$
                    TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME=FILEPDF,$
                    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                    TO_EXCEL=OFF,$
                    PREVIOUS_RUNS=DELETE_INSTANCES​
    

    Build the file path in an assignment and then print through the print command at the end of the program.
    You can include any inputs you collect from the operator at the beginning of the program.

    HTH
  • Before the \\ is the location of the folder and after is the name of the file. I have not had any luck using variable assignments for file locations. Only with the naming of the file itself.
Reply Children
No Data