Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Have I missed something -
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01024207
Message ID:
01024605
Vues:
32
This message has been marked as the solution to the initial question of the thread.
John,

An external program cannot see report in the APP/EXE it's called from. The code you're passing to EXECSCRIPT() is compiled into a temporary (external) program and then executed. That's why it cannot see reports in APP. You'll have the same problem if you try to excute a form from APP/EXE using EXECSCRIPT().

>>Can you create a simple repro of the problem and email it to me?
>
>Sergey
>
>I have found the problem - it's hilarious.
>
>1. Create a new blank project.
>2. Create two subfolders: Progs, Reports
>3. Save a new report with a 'Fruit' field as Reports\Report1.frx
>4. Save the code below to Progs\Prog1.prg
>5. Build and run the project (app or exe)
>
>If you click 'No' the report runs fine. If you click 'Yes' you get the 'File does not exist' error - the app cannot see the report file in its subfolder when it's part of an EXECSCRIPT script, but it can when the name expression is used.
>
>This may have been in VFP since EXECSCRIPT was introduced. I am resigned to imagine it is by design, although I cannot think why.
>
>John Burton
>
>#INCLUDE FOXPRO.H
>
>CREATE CURSOR TestReportCursor (Fruit C(20))
>INSERT INTO TestReportCursor (Fruit) VALUES ("Apples")
>INSERT INTO TestReportCursor (Fruit) VALUES ("Oranges")
>INSERT INTO TestReportCursor (Fruit) VALUES ("Pears")
>
>DO WHILE .T.
> n = MESSAGEBOX( ;
> "Run the report." + CHR(13) + CHR(13) + ;
> "Yes = Use the EXECSCRIPT syntax" + CHR(13) + ;
> "No = Don't use it" + CHR(13) + CHR(13) + ;
> "Cancel = Quit", ;
> MB_YESNOCANCEL+MB_ICONQUESTION, ;
> "Choose the method")
>
> cReportFile = "Report1.Frx"
> DO CASE
> CASE n=IDYES
> * cReportFile could be parameterised to any report file
> EXECSCRIPT([REPORT FORM "] + cReportFile + [" TO PRINTER PREVIEW])
> CASE n=IDNO
> * ditto
> REPORT FORM (cReportFile) TO PRINTER PREVIEW
> CASE n=IDCANCEL
> EXIT
> ENDCASE
>ENDDO
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform