Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I've created a listbox where i load all files from a givenfolder using this code in my script:
Set vConcatenate = ;
FileList:
LOAD
'' AS SourceFile
AUTOGENERATE 0;
Sub ScanFolder(Root)
for each FileExtension in 'qvw'
for each FoundFile in filelist( Root & '\*.' & FileExtension)
FileList:
LOAD '$(FoundFile)' as SourceFile
AUTOGENERATE 1;
Set vConcatenate = Concatenate;
next FoundFile
next FileExtension
for each SubDirectory in dirlist( Root & '\*' )
call ScanFolder(SubDirectory)
next SubDirectory
end sub
Call ScanFolder('C:\Users\Espen\Documents\Prosjekter') ;
Questions:
1. I would like to do this on a server - How do I define paths?
2. This code is specific for .qvw files only, I will modify it so that it will look for all kinds of file extension in the folder. I'd like the user to click on a line in textbox if he want to open that particular document. I've look at some action functions, like the Launch, but i'm not sure how to use it, or if that is the best solution?
Kind regards
ES
I got some help and ended up with this code in the script:
Load
'http:\\181.1.12.119\REPORTS\' & FileName() as Path,
FileName() as Filename,
FileTime() As Filetime,
Month(FileTime()) As Month,
Year(FileTime()) As Year,
FileExtension() As FileExtension
from ..\Word and pdf\*;
Followed up by this expression in a straight table:
='Click here<url>' & Path
Case solved 🙂
Hello Espen,
For 1:
We use relative paths in our applications for qvd, excel etc load. The DEV environment has the similar folder structure as production environment, so the relatives paths are helpful in this.[..\..\..\qlivkviewapps\ProjectName]
For 2:
Did you tried using Launch at first?
Thanks,
Angad
I got some help and ended up with this code in the script:
Load
'http:\\181.1.12.119\REPORTS\' & FileName() as Path,
FileName() as Filename,
FileTime() As Filetime,
Month(FileTime()) As Month,
Year(FileTime()) As Year,
FileExtension() As FileExtension
from ..\Word and pdf\*;
Followed up by this expression in a straight table:
='Click here<url>' & Path
Case solved 🙂