Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 2 Jahren
Letzter Beitrag:
vor 2 Jahren
Beteiligte Autoren:
stefan.kern, Allard, Arie, StanleyBarnett, Mark Crichton

Reports % Queries

Startbeitrag von stefan.kern am 23.05.2016 05:53

Hello Forum,

mybe someone could help me with following problem.

I would like to use reports and Queries in my app, and I would like allow my users to Change the global Report path.

I tried to Play around with freportsandqueriesdir(), but the Settings in the WX File seem to have a higher priority ...., as my freportsandqueriesdir() settings seem to be ignored.
I had the idea to edit the WX File programmaticly, but as it is located beside the EXE in the programs (x86) Directory the user needs admin rights, which my users don't have.

Maybe someone has an idea how to modify the r&q workirectory??

Thanks and Best Regards



You want to use reports and queries so users can make their own reports ?



von Allard - am 27.05.2016 21:08
Hi Allard,

no,they should not create own reports, the should be able to alter existing reports (add logos and so on.)
But I want my users to be able to change the global reports and query direcrory programmaticly ....

Best Regards


von stefan.kern - am 27.05.2016 21:16
I see

I have that partially for the invoice creation. User can choose a template report and adjust it .
The they can save the adjusted report.

when printing the invoice they can choose a template , if they have more than one templated added.

Is that what you need. Or do you need them to specific change the path to the report?

if so i can give you some code if you provide me an email adres


von Allard - am 28.05.2016 20:47
Hi Allard,

the installation procedure of WD proposes a path to store the global reports.
I need to change this path programaticly, if the users decide to use another path.

The main reason is, that I distribute testversions of the software by internet which is limited to one PC. After that the users buy the software, and want to use it in a network environment, and then they need to store the reports for example on a network share.

Thats why I want to change the path:
What I did as a test is:


sWXFileName is string = "LuSigFox.WX"
sWXPath is string = fExeDir
sWXFullPath is string = CompleteDir(sWXPath)+sWXFileName

sLocalDir is string = fGlobalDirCommon()+"\cargofox-software\lusigfox\raq\"
nFile is int

IF fFileExist(sWXPath) = False THEN
nFile = fCreate(sWXFullPath)

sString is string
sString = "[WDREPORT]"+CRLF
sString = sString + "LOCAL_DIR="+sLocalDir + CRLF
sString = sString + "GLOBAL_DIR="+gclApp:stAppSession.sReqPath
\\where gclApp:stAppSession.sReqPath is something like \\server\mycompany\myproduct\reports


But this works only if the user has admin rights (right click, run as admin)

That is what I want to avoid ....
My mail: stefan.kern[AT]cargofox-software.de

If you have any idea I would be very happy ::)

Best Regards


von stefan.kern - am 29.05.2016 22:03
Hi Stefan,

Why not read and write those values to the registry. Its not that hard, at least in VFP. I assume there are Wlanguage registry functions.

If you need to move files from the program files folder to another location, you will need to copy them to the new location without elevating. Store the new (chaged) path in the registry and read that value when that path is needed. The original files will still be with the .exe, just not used or referenced anymore.

An easier option is to use a local datafile.. useful for storing other local settings, (ie: preferred printer, paper size and orientation and etc....

Thanks, Stanley

von StanleyBarnett - am 31.05.2016 02:08
Hi Stephen

I have complex situation and store paths and custom reports in a setup file and build the path for every report run. Works fine.

However I am considering storing the reports in a file in binary field and that should be easier. Have tested it for backing up and emailing reports and it works well.

von Mark Crichton - am 01.06.2016 11:14
Hi Mark and Stanley,

thanks for your reply.
I can write the path in regestry or in a database, that is not the Problem.

My Problem is, how to tell Reports and Queries where to find the Report, so that the users can alter it.

There is the functions fReportsandQueriesDir() which returns the path, I Need something to SET the path.

Best Regards


von stefan.kern - am 01.06.2016 16:09

according to the help you can use fReportsandQueriesDir() also to SET the path
= fReportsAndQueriesDir( [, ])

von Arie - am 01.06.2016 16:31
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.