Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Modify report command in a modal form ??? Need help
Message
From
24/04/1998 21:58:07
 
 
To
24/04/1998 07:02:24
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00094612
Message ID:
00094829
Views:
27
>I can't execute a 'modify report' command in a modal form. The report design window appears for a moment and then disappears. There are solution for this ???

Waaaa, Modify Report means you want to 'Design' the report in Run Time!
Actually, the Run Time VFP library is only for run command other than Design!
If you really want to design, you need to got VFP installation on Running PC
and using WinAPI to call VFP.exe to run on you report!!

The command I searched from regedit will be:
c:\program files\vfp\vfp.exe -shell [FileName]

But, I am afraid that you cannot rebuild the execute file during RUNNING!!
The only thing is you can use textbox to carry the new report name and use
it when you press a button to confirm.
* cmdPrint.Click Coding with a textbox txtReportName, opPrint to action choice
WITH THISFORM
if empty(.txtReportName.Value)
  messagebox([Sorry, no ReportName is Selected!!], 48, [CmdPrint Error])
else
  if !file(alltrim(.txtReportName.value))
    messagebox([Sorry, Report File not Found!!], 48, [CmdPrint Error])
  else
    PrintCmd = [Report From ] + alltrim(.txtReportName.value)
    DO CASE
	CASE ThisForm.ogPrint.VALUE = 1	&& PREVIEW
		PRINTCMD = PRINTCMD + ' PREVIEW'
	
	CASE THISFORM.OGPRINT.VALUE = 2	&& PRINT NOW
		PRINTCMD = PRINTCMD + ' TO PRINTER NOCONSOLE'
    ENDCASE
	* Ensure the printer name is selected
	APRINTER(APR)
	IF THISFORM.GETPRINTER == "" OR EMPTY(ASCAN(APR, THISFORM.GETPRINTER))
	* if default printer name is not found!
		PR = GETPRINTER()
		THISFORM.GETPRINTER = '&PR'
	ENDIF
	* assigning printername
	SET PRINTER TO NAME (THISFORM.GETPRINTER)
	
	PrintJob
	* assigning any print option. BeginPage, EndPage, Num of Copies
	_PBPAGE = 1	&& Of cos you can add more txtbox to control
	_PEPAGE = 32767	&& Endpage
	_PCOPIES = 1	&& 1 copy
	
	&PrintCmd	&& Run Print Command Macros
	messagebox([Finish Print Job], 48, [Justok Tells....])
	EndPrintJob
  endif  && End File
endif  && End Empty
ENDWITH
Of cos, You also can use File Array to set on Combox to select what existed
in current directory!

I still study the 'Spyin' on WinApi calling as I have not enough time. >_<"

But I am not sure calling VFP.exe to design the report will hold the executable
file pause and wait you save the new report first.
If so, pls tell me! ^_^;

Anyway, I still suggest you don't want to do any design job on Run Time Execute.
This flexible idea will enlarge more chance on error and harmful if you forgot
to save data when use!! All work done will ignore!!

The above coding seem having problem on File() statement, can any expertise
tell me why seem not work. ~~>_<~~

p.s. 'Spyin' is a VFP I download from NET and thanks for author.
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform