Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mix .EXE and .APP - problem with showing report
Message
From
15/09/2014 13:50:53
 
 
To
15/09/2014 11:33:32
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01607502
Message ID:
01607554
Views:
71
>>>Hello!
>>>
>>>I have a problem with showing reports in Visual FoxPro.
>>>
>>>My application consists of an .exe file which contains most of the code and an .app file that I run on start to add some more functionality accessible via a menu.
>>>Each of these two files have reports included in them.
>>>
>>>When I tried to show a report from the code in APP I got a File not found error. As a workaround I've excluded the report files from the APP project and placed it somewhere on the disk. So when I create a report I use it's physical location on the disk. And this works.
>>>
>>>What also works is if I show a report first from the EXE code and then from the APP code.
>>>What doesn't work is if I show a report first form the APP code (it shows as expected) and then from the EXE code later (I get a File not found error).
>>>
>>>The solution would be to exclude ALL the reports from both projects and put them on the disk but that would be extremely impractical.
>>>
>>>Does anyone have any ideas what could be causing this?
>>
>>As I understand it VFP will look for files in EXEs or APPs in the current call stack. If you're running a report from your APP and it's in the APP, it should be found. You might need to closely examine the actual call stack when you're doing that.
>>
>>Some settings that may come into play are SYS( 2450 ), SET PROCEDURE and SET PATH. You might check whatever settings are already in use.
>
>Since FRX/FRT files are only visible with the module into which they are compiled, you'll find that APPs called from an EXE can't access the FRX/FRT compiled into the EXE, likewise you won't be able to have the EXE reference a FRX/FRT that was built into the APP. One workaround is to have a routine inside the EXE and APP used for copying out selected report files to a temporary file -- then reference the copy. Procedures and functions defined within the caller are visible in the called APP -- the reverse can be made possible by having the EXE call a routine in the APP that then calls a routine that is contained in EXE -- which then makes available the procedures/functions defined in the APP to the EXE because the APP is found in the call stack. This is a variation of a kludge that I'd use to effectively have more than one SET PROCEDURE in FPD and FPW -- having a "callthru" chain where the main PRG in the EXE would call main procedure in an APP that would chain to another APP, to another, then finally to a procedure that was defined in the main PRG in the EXE (granted you lose the limited call levels that way)..

Looking at your first sentence, that means he should be able to always run an InAPP report from the APP (or at least have the FRX visible/found). But he seems to be having problems with that, so something else must be going on.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Reply
Map
View

Click here to load this message in the networking platform