Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to pass parameter to REPORT
Message
De
13/09/1999 21:53:21
 
 
À
13/09/1999 08:50:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00263936
Message ID:
00264304
Vues:
22
>Hi,
> How could I pass a LOCAL VARIABLE to report ?
>
>Thank you



Hi All! After discussion, give him some +ve advise!!

First, I suggest you Use a View (Local/Remote) to
make a set of all fields including some calculated field!!
(e.g. Select OrdItems.Qty * Item.SellPrice As RowTotal, .....)
To make Calculated field, at View Designer,
Left Bottom Textbox with a [...] button at right!

Benefits:
Define One Time and can be REUSE in All other similar Reports!
PreDefine the Calculated can shorten the field formula at report,
so that you can easy to maintain if the required formula change!!
e.g. You need to make a Quote sheet with 20% OFF price, but now is 25% OFF
What you need to do is to adjust the View is finished WHEREAS
you need to modify all report if you defined the formula in each quote report!!

Besides, you can simply trace out why there is Nothing on Selected
As you only need to find out the View result, otherwise, you need to trace out
each report DE problem.. surely hard to trace!!




Now, how you pass a Parameters to Report has changed to:
How you pass a Parameters to View!
At View Designer, at Condition Tab, add a where cause expression Like:

ALLTRIM(UPPER(?ThisForm.PrtKey))$ALLTRIM(UPPER(myTABLE.myKEY)) = .T.

PrtKey is a new property of a form!
* ThisForm.CmdPrint.Click
ThisForm.PrtKey = MyTable.MyKey	&& Take the Current Record!

IF THISFORM.GETPRINTER = []
	PR = GETPRINTER()
	IF EMPTY([&PR])
		RETURN		&& SKIP PRINTING
	ENDIF
	THISFORM.GETPRINTER = [&PR]
ENDIF
SET PRINTER TO NAME [&PR]


PRINTJOB
	_PBPAGE = ThisForm.txt_pbpage.VALUE	&& Start Printing Page
	_PEPAGE = ThisForm.txt_pepage.VALUE	&& End Printing Page
	PRINTCMD = [REPORT FORM ] + lSelectedReport + [ RANGE ] +;
		ALLTRIM(STR(_PBPAGE)) + [,] +;
		ALLTRIM(STR(_PEPAGE)) + [ PREVIEW]

	KEYBOARD '{CTRL+F10}'	&& MAXIMIZE PREVIEW WINDOW
	&PRINTCMD	&& Use macros to Print get more fixible!
ENDPRINTJOB



^_~ I'll also put this message on Knowledge Base, sure helpful for beginner!
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform