Page 1 of 1
Standalone File Path Incorrect
Posted: Wed Feb 03, 2016 2:16 pm
by nicoloose
I have built a standalone app that connects to MySQL DB. When printing a report with Quartam, the standalone will not find the .qll file and display an error with a filepath that does not reflect the actual path given during testing.
Code: Select all
put defaultFolder & "/costofsales" into tLayoutFile
put the long ID of me into tDataBroker
put true into tShowPreview
-- print the report
qrtReports_PrintReport tLayoutFile, tDataBroker, tShowPreview
See attached.
Please help.
Re: Standalone File Path Incorrect
Posted: Wed Feb 03, 2016 3:02 pm
by Klaus
Hi Nico,
well, things are different on Mac OS X in a standalone!
Did you use the "Copy files" tab in the standalone builder settings to add your "layout" file(s)?
If yes then you need to:
...
put specialfolderpath("resources") & "/costofsales" into tLayoutFile
...
If not, please tell us where you put your files.
Hint:
specialfolderpath("resources") does also work in the IDE!
It will return folder where the stack resides which will turn into the standalone,
so you could use this specialfolderpath thorughout!
Best
Klaus
Re: Standalone File Path Incorrect
Posted: Wed Feb 03, 2016 3:14 pm
by nicoloose
Hi Klaus,
All my files sit in the same directory as the standalone. Since this is just an internal app, I manually copy everything I need.
Nic
Re: Standalone File Path Incorrect
Posted: Wed Feb 03, 2016 3:18 pm
by Klaus
OK, but "the defaultfolder" is not the one you are exspecting in an OS X standalone, as you now know!
It is the folder where the APP package resides in and not "ManufacturingPro.app/Contents/MacOS"!
Re: Standalone File Path Incorrect
Posted: Thu Feb 04, 2016 1:14 pm
by nicoloose
Could you possibly assist with a solution for rollout to both Mac and Windows? I have been testing various options all day but the Standalone version on Mac never points me to the correct path.
Re: Standalone File Path Incorrect
Posted: Thu Feb 04, 2016 1:29 pm
by Klaus
Hi Nico,
please read my first posting again, it already contains the solution!
During development, put your "layout" file(s) into the same folder as your stack and access them in script(s) with
...
put specialfolderpath("resources") & "/costofsales" into tLayoutfile
...
Then add them via the "Copy files" tab in the standalone builder and the SAME script(s) will still work in the standalone!
Best
Klaus