hexagon logo

Report file path keeps changing

I have the exact file path/folder I want selected in the print output for all of my programs, but it keeps changing on me. It seems to always default to the location of the previous program I ran, and I have to manually select the correct output folder each time I print the report. The filename and the index number, however, are always correct. It's just the destination that keeps changing. It does not change if I keep the same program open and run it multiple times. It only changes when I close the current program and open a new one. Does anyone else have this issue? I have a network drive selected as the output destination. Does that have anything to do with it?
Parents
  • At the start of my programs I assign the path to a variable.
    Like this:
    ASSIGN/REP_NAME="\PART_DFS3206"
    ASSIGN/SUB_PATH='"CUSTOMER\DFS3206"
    ASSIGN/PDF_PATH='J:\\PROTOKOLLS\"

    The first 2 ASSIGNS is changed, depending on the customer and partnumber.
    The third ASSIGN is never changed, it points the PDF-Report to the right folder on my server.


    When the program is through , I add som info to the filename.
    Ordernumber (input from the operator), Date and Time, so feel free to follow this setup

    ASSIGN/DATE=SYSTEMDATE("yyyy-MM-dd")
    ASSIGN/TIME=SYSTEMTIME("HH-mm")
    ASSIGN/REPDATETIMEORDER=REP_NAME + "_" DATE + "_" + TIME + "_" + ORDERNO.INPUT
    ASSIGN/FILENAME=PDF_PATH+SUB_PATH+REPDATETIMEORDER+".PDF"


    The key variable is now the variable FILENAME

    When I at the end does the printing, I have the settings in the PRINT-command
    TO_FILE=ON
    OVERWIRTE=FILENAME



    The only thing I have to adjust in every new program is the content in the 2 lines
    REP_NAME & SUB_PATH

    Easy peasy!



Reply
  • At the start of my programs I assign the path to a variable.
    Like this:
    ASSIGN/REP_NAME="\PART_DFS3206"
    ASSIGN/SUB_PATH='"CUSTOMER\DFS3206"
    ASSIGN/PDF_PATH='J:\\PROTOKOLLS\"

    The first 2 ASSIGNS is changed, depending on the customer and partnumber.
    The third ASSIGN is never changed, it points the PDF-Report to the right folder on my server.


    When the program is through , I add som info to the filename.
    Ordernumber (input from the operator), Date and Time, so feel free to follow this setup

    ASSIGN/DATE=SYSTEMDATE("yyyy-MM-dd")
    ASSIGN/TIME=SYSTEMTIME("HH-mm")
    ASSIGN/REPDATETIMEORDER=REP_NAME + "_" DATE + "_" + TIME + "_" + ORDERNO.INPUT
    ASSIGN/FILENAME=PDF_PATH+SUB_PATH+REPDATETIMEORDER+".PDF"


    The key variable is now the variable FILENAME

    When I at the end does the printing, I have the settings in the PRINT-command
    TO_FILE=ON
    OVERWIRTE=FILENAME



    The only thing I have to adjust in every new program is the content in the 2 lines
    REP_NAME & SUB_PATH

    Easy peasy!



Children
No Data