Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can preview those SELECTED, but not Print those SELECTED
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01221933
Message ID:
01221992
Views:
22
>>By the way, how does the grid not losing focus cause this problem?
>>
>>Thanks!
>
>Don't ask :-)
>VFP has this problem since its first version (I think, I stared with VFP5 and it was there).
>The Grid is my "favorite" control (other is ComboBox) Grid occupies everything, changes the current alias when you never expected, changes the current record of its RecortdSource Table/Cursor, goes blank when you change its rowsource etc..., so move the focus outside the Grid to some control that could receive it.
>Label could not receive the focus. If you have some TextBox, ComboBox or any control that has SetFocus Method just use it before at the begining of your printing routine. something like:
>
>Thisform.TextBox1.SetFocus()
>SELECT ...
>SET FILTER ....
>REPORT FORM ......
>
I've tried... here is an example
LOCAL lcRxCaption,llFirst,lcPharmacy,lcPhone

This.Parent.txtDrugFilter.SetFocus && To remove focus from the grid, so the report will print correctly

llFirst = .T.
Thisform.mousepointer = 11
Thisform.m_Actions(2)
ThisForm.txtStatus.value = "Printing Patient Medical Reports..."

SELECT rx
SET FILTER TO (marked = .T.)

GO top

IF NOT EOF()
	SELECT rx
	REPORT FORM RxPMR NOCONSOLE TO PRINTER PREVIEW
ELSE
	MESSAGEBOX("There are no Rx's selected to print the Patient Medical Report" + CHR(13) + ;
		"(To select a Rx, check it)",64,"Cannot Print PMR(s)")
ENDIF 

Thisform.grdProfile.SetFocus			&& Set focus back to grid 		
Thisform.mousepointer = 0
ThisForm.txtStatus.value = ""

* Reset grid
SELECT rx
IF Thisform.p_ViewType = 1
	SET FILTER TO INLIST(status,0,1,5)
ELSE
	SET FILTER TO
ENDIF
GO TOP IN rx
ThisForm.grdProfile.Refresh()
Thisform.m_Actions(1)
But it still doesn't work properly.... sigh.

Thanks!
Tommy Tillman A+ NetWork+ MCP
Previous
Reply
Map
View

Click here to load this message in the networking platform