Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pass variable to the report
Message
De
29/11/2005 06:08:18
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
29/11/2005 04:01:58
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01072697
Message ID:
01072714
Vues:
22
>Hi,
>I have a variable, txtCompanyName, create in a report using report designer,
>I want the variable txtCompanyName contain the Company Name which pass from a Form by press the command button which have following code.
>
>
>txtCompanyName="ABC Company"
>REPORT FORM incrpt16.frx TO PRINTER NOCONSOLE PREVIEW
>
>
>The result not success,how to pass the Company name to the variable in the report ?
>
>Please advise.
>
>Thanks.
>Derek

Derek,
You dont' need to create a variable in report. Just define it in the calling program (it could be local, private .. etc.). Report is a command and thus have access to all variables (including form objects) accessible by the calling routine.

ie:
public oForm
oForm = createobject('myForm')
oForm.Show

define class myForm as Form
add object myTextBox as textbox
add object myButton as CommandButton with top = 50

Procedure myButton.Click
local txtCompanyName
txtCompanyName="ABC Company"
report form myReport preview
endproc
enddefine
myReport could use fields with expressions like:

m.txtComapanyName
thisform.myTextBox.Value

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform