hexagon logo

Autosave reports

Im still new to programming PC-DMIS . i was wanting to add in the feature that if there is nothing out of tolerance that it would save the report and create a new folder for each Work order. i have found some other forums about it already. i keep getting a error with my create.bas file. C2 =COMMENT/INPUT,YES,FULL SCREEN=NO,
WORK ORDER
ASSIGN/V1=C2.INPUT
C3 =COMMENT/INPUT,YES,FULL SCREEN=NO,
PART NUMBER
ASSIGN/V2=C3.INPUT
END =GROUP/SHOWALLPARAMS=YES
SAVE_REPORT =GROUP/SHOWALLPARAMS=YES
ASSIGN/FOLDERPATH="C:\USERS\ADMINISTRATOR\DOCUMENTS\TEST"
ASSIGN_FILE =GROUP/SHOWALLPARAMS=YES
ASSIGN/FOLDERNAME=\FOLDERPATH+"(REPORT_NAME)"+"+V2+"\
ENDGROUP/ID=ASSIGN_FILE
ASSIGN/PRINT_PATH=FOLDERNAME+GETPROGRAMINFO("PARTNAME")+"_"+V2+"_"+V1+".PDF
CREATE_FOLDER =GROUP/SHOWALLPARAMS=YES
CS1 =SCRIPT/FILENAME= C:\USERS\ADMINISTRATOR\DOCUMENTS\TEST\CREATE.BAS
FUNCTION/PCDCreatefolder,SHOW=YES,ARG1=PRINT_PATH,,
STARTSCRIPT/
ENDSCRIPT/
ENDGROUP/ID=CREATE_FOLDER
REDRAW =GROUP/SHOWALLPARAMS=YES
CS2 =SCRIPT/FILENAME= C:\USERS\ADMINISTRATOR\DOCUMENTS\TEST\REDRAW.BAS
FUNCTION/Main,SHOW=YES,,
STARTSCRIPT/
ENDSCRIPT/
ENDGROUP/ID=REDRAW
SAVE_PDF =GROUP/SHOWALLPARAMS=YES
PRINT/REPORT,EXEC MODE=END,$
TO_FILE=ON,AUTO=PRINT_PATH, OUTPUT_FORMAT/PDF,$
RESET_REPORT=YES,AUTO OPEN=OFF,$
TO_PRINTER=OFF,COPIES=1,$
TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME=FOLDERNAME,$
REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
TO_EXCEL=OFF,$
PREVIOUS_RUNS=DELETE_INSTANCES
ENDGROUP/ID=SAVE_PDF
ENDGROUP/ID=SAVE_REPORT
ENDGROUP/ID=END