Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Weirdness, again!
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 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01438927
Message ID:
01438929
Vues:
62
REPORT FORM command moves the record pointer to the end of the file. You must save the current record number and restore it after REPORT FORM command.

Also you must switch focus to some other object than grid before REPORT FORM command.

>Hi Gang!
>
>I came across some Grid weirdness on Friday... here is what happened....
>
>A) I have written some code to print out a "monograph" of a prescription from a grid that shows the prescriptions. I press the Print Monograph button and this is the code that runs...
>
>
>LOCAL lcLanguage
>
>IF glDemo
>	MESSAGEBOX("Option not available for demo",64,"Demo")
>*TMN 10/25/07
>	RETURN
>ENDIF
>
>*TMT 12/07/09 new code to print the monograph from the profile form
>DO CASE
>	CASE USED('language')
>		IF LANGUAGE.item_code = 'S'
>			lcLanguage = 'S'
>		ELSE
>			lcLanguage = 'E'
>		ENDIF
>	CASE USED('patient_master')
>		IF patient_master.LANGUAGE = 'S'
>			lcLanguage = 'S'
>		ELSE
>			lcLanguage = 'E'
>		ENDIF
>	OTHERWISE
>		lcLanguage = 'E'
>ENDCASE
>
>*TMT 12/08/09 First, get the Thisform.p_RefillsLeft value, since it doesn't have one at this point unless
>*we go to the White Screen first (Activate on the White Screen - fill)
>THISFORM.m_pillsrefillsleft
>*Next, we run the m_ProcessRx to get set up to print the label and/or Monograph
>THISFORM.udcMedispan.m_ProcessRx(rx.rx_no,rx.refill_no,rx.patient_id,rx.doctor_id,rx.drug_id,rx.days_supply,rx.usage,rx.quantity_filled,rx.quantity_rx,rx.filled_date,.F.)
>
>*TMT 12/08/09 The medispan_io.pe_repwr will have the full Free-flowing Monograph in it if it exists for this
>*rx and drug at this time....  If not, then we can't print it.
>*In m_processRx above, the medispan_io record for this rx is converted over to many records in the
>*medispan_out table to be printed in the reports below...
>DO CASE
>	CASE EMPTY(medispan_io.pe_repwr)
>		MESSAGEBOX("There is no monograph for this drug.",48,"No Monograph")
>	OTHERWISE
>		SET PRINTER TO DEFAULT
>*TMT Set focus to DONE button so we don't see the RX table from the GRID
>		THISFORM.cmdDone.SETFOCUS()
>		SELECT medispan_out
>		DO CASE
>			CASE lcLanguage = 'E'
>				REPORT FORM MonoBoldProfile NOCONSOLE ALL TO PRINTER PROMPT
>			CASE lcLanguage = 'S'
>				REPORT FORM MonoBoldSpanishProfile NOCONSOLE ALL TO PRINTER PROMPT
>			OTHERWISE
>				REPORT FORM MonoBoldProfile NOCONSOLE ALL TO PRINTER PROMPT
>		ENDCASE
>ENDCASE
>
>*TMT Reset focus back to GRID
>THISFORM.grdProfile.SETFOCUS()
>SELECT rx
>RETURN
>
>
>
>This worked fine and well on MY code on my local PC. You select a record in the grid, print the monograph (the select your printer dialogue comes up, pick your printer, and let it print), and the printer dialgoue goes away and focus returns to the grid and BACK TO THE RECORD YOU HAD PICKED.
>
>When I put this code into the testing code (shared code base) on the network, then copied all the code of this project back done on my PC to check it out and test it, it did not work correctly. Now, when the printer dialogue box disappears, the grids record jumps to the LAST record, not the one I had picked originally.
>
>I checked through the bad behaving form and grid (the methods and events, and they appear the same).
>
>So, what would you look for first to see what is the cause of this difference?
>
>Thanks a bunch!!
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform