Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Run external program and pass parameter
Message
De
09/01/2015 11:41:52
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01613348
Message ID:
01613359
Vues:
50
You're welcome.

The Textmerge() function was probably added in VFP9. Which reminds me, be really quick if you want to upgrade to VFP9. You still have three more days to do it, then it's no longer possible, ever.

>Hello,
>
>I got a "function missing" error on the Textmerge command, so I did a TEXT TO lcPar NOSHOW TEXTMERGE.
>
>Other than that, it works like a charm.
>
>Now I can move away from my antiquated Crystal Reports.
>
>Thanks for your help.
>
>TFISHER
>
>>>Hello,
>>>
>>>I am trying to run a Telerik Report from withing my VFP8 /SP1 desktop application. I can get the Report to open; however, I am having difficulty passing the GUID value as a parameter.
>>>
>>>This command works to open the report: RUN /n &lcProgram &lcReport Case_ID lcCID
>>>The lcProgram variable is the path to the Telerik Report Program.
>>>The lcReport variable is the path to the actual Telerik Report.
>>>Case_ID is the Telerik Report Parameter.
>>>lcCID is the Telerik Report Parameter Value.
>>>
>>>When I run the above command, the Telerik Report viewer opens and "lcCID" is in the parameter value field. The report is blank. (I need the value of lcCID which is "AFD6E102-944B-3D4F-B697-5731D8D267F3."
>>>
>>>If I manually past the lcCID GUID value into the parameter value field after the Telerik Report opens, the report displays just fine.
>>>
>>>Question: How do I pass the lcCID GUID value (AFD6E102-944B-3D4F-B697-5731D8D267F3) to the Telerik report in plain text?
>>>
>>>I have played with various scenarios with no luck:
>>>-- Error -- RUN /n &lcProgram &lcReport Case_ID &lcCID
>>>-- Error -- RUN /n &lcProgram &lcReport Case_ID "AFD6E102-944B-3D4F-B697-5731D8D267F3"
>>>-- Error -- RUN /n &lcProgram &lcReport Case_ID AFD6E102-944B-3D4F-B697-5731D8D267F3
>>>-- Error -- RUN /n &lcFullPath Case_ID lcCID
>>>-- Error -- RUN /n &lcFullPath Case_ID "AFD6E102-944B-3D4F-B697-5731D8D267F3"
>>>-- Error -- RUN /n &lcFullPath Case_ID AFD6E102-944B-3D4F-B697-5731D8D267F3
>>>-- Error -- RUN /n &lcFullPath &lcCaseID
>>>-- Error -- RUN /n &lcProgram &lcReportNP Case_ID &lcCID
>>>-- Error -- RUN /n &lcProgram &lcReportNP Case_ID "AFD6E102-944B-3D4F-B697-5731D8D267F3"
>>>-- Error -- RUN /n &lcProgram &lcReportNP Case_ID AFD6E102-944B-3D4F-B697-5731D8D267F3
>>>
>>>Any ideas of what to try next?
>>>
>>>Thanks,
>>>TFISHER
>>
>>No need for Run, Shellexecute is far better.
>>
lcProg = fullpath(lcProgram)
>>lcPar = textmerge(<<lcReport>> Case_ID <<lcCID>>)
>>Shellx(lcProg, lcPar)
>>
>>
>>*ShellX.prg:
>>*To use:
>>*
>>*lcProg = 'Yourpath\yourprog.exe'
>>*lcPar = 'some parameters' && Drop this line if no parameters
>>*ShellX(lcProg, lcPar)
>>Lparameters tcURL, tcParameter
>>if empty(tcParameter)
>>   tcParameter = ''
>>Endif
>>#define SW_HIDE 0
>>#DEFINE SW_SHOWNORMAL 1
>>#DEFINE SW_SHOWMINIMIZED 2
>>#DEFINE SW_SHOWMAXIMIZED 3
>>*!*   Legal verbs: open, edit, print, find, explore, NULL
>>DECLARE INTEGER ShellExecute IN shell32.dll ; 
>>   INTEGER hndWin, STRING cAction, STRING cFileName, ; 
>>   STRING cParams, STRING cDir, INTEGER nShowWin
>>ShellExecute( 0, "open", tcURL, tcParameter , "", SW_SHOWNORMAL )
>>
>>Update: If there's spaces it the path, you must add apostrophes, like this
>>
>>lcPar = textmerge("<<lcReport>>" Case_ID <<lcCID>>)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform