DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Save data and report in subfolder

Solved!
Go to solution

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

0 Kudos
Message 1 of 5
(5,809 Views)

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

Message 2 of 5
(5,785 Views)

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) 

 

 

 

0 Kudos
Message 3 of 5
(5,779 Views)
Solution
Accepted by topic author Giova

Giova

 

Just put in the  "/" between the Documents and the file name.

 

Paul

 

0 Kudos
Message 4 of 5
(5,774 Views)

Perfect!

 

0 Kudos
Message 5 of 5
(5,765 Views)