PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Reports % Queries
Reports % Queries
Iniciado por guest, 23,may. 2016 07:53 - 5 respuestas
Publicado el 23,mayo 2016 - 07: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

Stefan.
(WD20)
Publicado el 27,mayo 2016 - 23:08
You want to use reports and queries so users can make their own reports ?

regards

Allard
Publicado el 27,mayo 2016 - 23:16
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

Stefan.
Publicado el 28,mayo 2016 - 22:47
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

regards
Allard
Publicado el 30,mayo 2016 - 00:03
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\ aq\"
nFile is int

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

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\ eports
fWrite(nFile,sString)
fClose(nFile)

RESULT True

======
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

Stefan.
Publicado el 31,mayo 2016 - 04:08
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