Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to display a textbox value in a

Status
Not open for further replies.

ahmed1973

Programmer
Jan 29, 2013
42
DZ
how to display a textbox value in a report
 
Hi Ahmed,

Welcome to the forum.

You get the value of a textbox by reference to is Value property. So if the textbox is named Text1, and if loForm is the form that contains it, the following code will store the value of the textbox in a variable named lcVal:

Code:
lcVal = loForm.Text1.Value

To get that value in a report, simply refer to the same variable. However, you must make sure that the variable is in scope while the report is running. The easiest way to do that is to declare it as private:

Code:
PRIVATE lcVal
lcVal = loForm.Text1.Value

REPORT FORM .......

In the report itself, just set the expression of the relevant field to lcVal.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
It's a not well known fact also variables Local to the code containing the REPORT FORM command are in scope within a report. That doesn't invalidate anything Mike said. It just can be good to know that.

Bye, Olaf.
 
sorry, i would like to know how do do i write it in the exprssion builder i mean lcVal
thank u mike
 
thank u very much mike its work, I hav found the method
 
Yes, it's really just like writing a field name, just this time it's a variable name.

The box is labeled "Expression", which literally means you can type in any expression, also "constant string" or 1+1 or DATE()+7 or Yourfunction(field) or whatever you like. Any expression. Any result type is allowed, just as the field type also doesn't matter.

Bye, Olaf.
 
hi friends
I have a probleme of language, Id like to write in a textbox with arabic automatically without go to the language bar
 
PLEASE ANYONE KNOWS HOW TO WRITE A VALUE IN ARABIC automatically without go to the language bar
 
That's mainly a seperate question, only partly related, because it's still the textbox. But it's a more general thing, isn't it? You should start a new thread for that.

I have no idea what a language bar is, probably part of arabic Windows Versions.

When you run Foxpro on an arabic Windows, it should use the system codepage 1256. What is displayed, if you type at the command window:

Code:
? CPCURRENT()

Besides that you should override the textbox default setting of the RightToLeft Setting to .T. instead of .F.

Bye, Olaf.
 
Ahmed,

I agree with Olaf that you should start a new thread for this. It's likely to be a big discussion, and one that might interest other people, so it's better not to confuse it with your original question.

Please post the question again, in a new thread, and give as much detail as possible about what you want to achieve and what you have already tried.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Besides the Textbox.FontCharset should be set to 178 for the Arabic subset of some fonts (eg this works for Arial).
To find out this number, start this:

Code:
? GetFont("Arial",10,"Bold")
Choose Arabic in the combobx entitled "Skript" in that dialog and then click OK, the FontCharSet will then be returned as the last part of the return value.

Bye, Olaf.
 
I have three textboxes and input values must be in arabic.to avoid changing language from the windows in the bottom of the screen,I d like to know if there is a command to write it in a code to make this textboxes receive just the arabic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top