Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can preview those SELECTED, but not Print those SELECTED
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01221933
Message ID:
01223163
Vues:
18
Tommy,

By quick glance few things I noticed.

1)
*Count the number of marked records in this filter range

DO WHILE NOT EOF('rx')
	IF marked = .T.
		llMarked = .T.
		EXIT 
	ENDIF
	SKIP  
ENDDO 
The comment doesn't correspond to what you're trying to do. You were just trying to find, if you marked at least one record. You can do
count to nMarked for Marked

2) SELECT rx
> Thisform.cntActions.txtDrugFilter.Enabled = .T.
> Thisform.cntActions.txtDrugFilter.Visible = .T.
> Thisform.cntActions.txtDrugFilter.SetFocus
>
> REPORT FORM RxPMR FOR marked = .T. NOCONSOLE TO PRINTER PREVIEW
>
> Thisform.cntActions.txtDrugFilter.Enabled = .F.
> Thisform.grdProfile.SetFocus

Change this to:

> Thisform.cntActions.txtDrugFilter.Enabled = .T.
> Thisform.cntActions.txtDrugFilter.Visible = .T.
> Thisform.cntActions.txtDrugFilter.SetFocus
SELECT rx
> REPORT FORM RxPMR FOR marked = .T. NOCONSOLE TO PRINTER PREVIEW
>
> Thisform.cntActions.txtDrugFilter.Enabled = .F.
> Thisform.grdProfile.SetFocus

E.g. move Select rx right before REPORT FORM. I just had the same problem in the thread I gave you a reference and this Ed's suggestion solved it for me.

3) Make sure that Printer Environment is NOT SAVED with your report (e.g. you have it unchecked).

>
>LOCAL lcRxCaption,lcPharmacy,lcPhone, llMarked, lcSetExact
>
>Thisform.cntActions.txtDrugFilter.Enabled = .T.
>Thisform.cntActions.txtDrugFilter.SetFocus
>
>llMarked = .F.
>
>*TMT This code below is from the lblOrderBy click method... modified slightly to not show the messagebox in it...
>STORE SET('EXACT') TO lcSetExact
>SET EXACT OFF
>
>Thisform.mousepointer = 11
>Thisform.m_Actions(2)
>ThisForm.txtStatus.value = "Printing Patient Medical Reports..."
>
>SELECT rx
>*TMT 05/04/2007 Added to set the environment so that the report will see the rx table correctly and be
>*able to print the marked records...
>
>*!*	IF Thisform.p_OrderBy = 1
>*!*		SET ORDER TO filldate IN rx
>*!*	ELSE
>*!*		SET ORDER TO decendrx IN rx
>*!*	ENDIF
>*!*	SET KEY TO (STR(Thisform.p_patient_id))
>GO TOP
>*
>
>*Count the number of marked records in this filter range
>DO WHILE NOT EOF('rx')
>	IF marked = .T.
>		llMarked = .T.
>		EXIT
>	ENDIF
>	SKIP
>ENDDO
>
>IF llMarked
>	SELECT rx
>	Thisform.cntActions.txtDrugFilter.Enabled = .T.
>	Thisform.cntActions.txtDrugFilter.Visible = .T.
>	Thisform.cntActions.txtDrugFilter.SetFocus
>	
>	REPORT FORM RxPMR FOR marked = .T. NOCONSOLE TO PRINTER PREVIEW
>
>	Thisform.cntActions.txtDrugFilter.Enabled = .F.
>	Thisform.grdProfile.SetFocus
>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.cntActions.txtDrugFilter.Enabled = .F.
>Thisform.grdProfile.SetFocus
>
>Thisform.mousepointer = 0
>ThisForm.txtStatus.value = ""
>
>IF Thisform.p_OrderBy = 1
>	SET ORDER TO filldate IN rx
>ELSE
>	SET ORDER TO decendrx IN rx
>ENDIF
>
>SELECT rx
>SET KEY TO (STR(Thisform.p_patient_id))
>
>IF Thisform.p_viewtype = 1
>	SELECT refill
>	SET FILTER TO INLIST(status,0,1,4,5)	&& 4 Included so batch Rx's cant be refilled
>
>	SET EXACT OFF
>	lcFilter = IIF(NOT EMPTY(Thisform.p_buffer),;
>			Thisform.p_previousdrugfilter + " AND UPPER(drug.name) = '" + ;
>			ALLTRIM(UPPER(Thisform.p_buffer)) + "' IN Rx",;
>			Thisform.p_previousdrugfilter + " IN Rx")
>	SELECT Rx
>	SET FILTER TO &lcFilter
>	GO TOP IN rx
>ELSE
>	SELECT refill
>	SET FILTER TO
>	
>	SELECT rx
>
>	SET EXACT OFF
>	lcFilter = IIF(NOT EMPTY(Thisform.p_buffer),;
>		"UPPER(drug.name) = '" + ;
>		ALLTRIM(UPPER(Thisform.p_buffer)) + "' IN Rx","")
>	SELECT Rx
>	SET FILTER TO &lcFilter
>	GO TOP IN rx
>ENDIF
>*Thisform.grdProfile.refresh()
>
>Thisform.m_UpdateStaticArea()
>Thisform.MousePointer = 0
>SET EXACT &lcSetExact
>
>ThisForm.grdProfile.Refresh()
>Thisform.m_Actions(1)
>
>
>The Report itself does not have a Data Environment.
>
>Still, the report will preview correctly on the screen... but does not print anything but a blank sheet when you select to print at that point.
>
>Also.... I tried a different printer for the Windows Default printer for it to print to.
>
>I changed to a Dot-matrix Okdidata Microline 320 and it printed a blank sheet, also.
>
>BUT... when I changed the default Windows printer back to the Lexmark T-644 Laser Jet.... the report went back AGAIN to the Okidate dotmatrix printer!!! It totally ignored the Windows default, and went with what it last used!!!!
>
>How is that possible??????? I am so........... confused!! (Could it be the Tag fields in the report???)
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform