04-25-2014 12:22 PM
Hi,
I spend one day trying to solve this "stupid" thing but now I raise my white flag.
Hope someone could show me the way.
In my script I want to organize the output result in such a way to have:
tdm files in "testdata" folder
pdf + xls in "testdata"\"document" folder
I'm able to create the testdata folder, but no idea how to create the subfolder.
The testdata folder should be a variable because it change test by test.
I've highlighted the error in my script.
dim myfold
myfold = inputbox("Inserire nome della prova", "diadem", DataSetName)
call foldercreate(DataReadPath & myfold)
call foldercreate(DataReadPath & myfold\"documents")
rem 'Save elaborated data
rem If (FileNameGet ("NAVIGATOR", "FileWrite", DataReadPath & DataSetName & myfold & "." & DataExtension) = "IDOk") Then
rem Else 'Dialog was canceled
rem Call MsgBoxDisp ("Data saving was canceled")
rem End If
Bye
Solved! Go to Solution.
04-26-2014 05:34 AM
Giova
You were very close to have it work. Just some syntax issues.
The lines below will make the documents directory under /testdata/
dim myfold
myfold = inputbox("Inserire nome della prova", "diadem", DataSetName)
callfoldercreate(DataReadPath & myfold)
callfoldercreate(DataReadPath & myfold&"\documents")
You mentioned that PDF and Excel were the next files to create. I have done both.
Here is some helpful PDF making code for report output.
dim ofso
Set ofso = CreateObject("Scripting.FileSystemObject")
'ReportPrintTransparency = 1 ' needed to display transparency colors
REPORTPrintAsGraphic = 0' needed to display transparency colors
PDFResolution = "600 DPI"
PDFOptimization = true
iffilex(gsPDFFileFullPath) then
ofso.DeleteFile(gsPDFFileFullPath)
endif
CallPicPDFExport(gsPDFFileFullPath)
Paul
04-26-2014 03:14 PM
Paul,
Thanks you so much for the help.
But I still have the same trouble to create the pdf file in the correct folder (documents).
If I apply the same rule of the foldercreate function, my pdf was create in the testdata folder with the name: documentstestdata.pdf.
dim ofso Set ofso = CreateObject("Scripting.FileSystemObject") ReportPrintTransparency = 1 ' needed to display transparency colors REPORTPrintAsGraphic = 0 ' needed to display transparency colors PDFResolution = "600 DPI" PDFOptimization = true if filex(DataReadPath & myfold&"\documents" & DatasetName) then ofso.DeleteFile(DataReadPath & myfold&"\documents" & DatasetName) end if Call PicPDFExport(DataReadPath & myfold&"\documents"& DatasetName)
04-26-2014 06:34 PM
Giova
Just put in the "/" between the Documents and the file name.
Paul
04-27-2014 02:38 PM
Perfect!