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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamics Properties in Foxpro SP2 1

Status
Not open for further replies.

Michael0025

Technical User
Oct 18, 2017
8
ID
How you set a different style in 1 textbox in report foxpro?
I want to set something like this
This is to introduce James, birth date 14-01-1992.
I read it at other thread that you can set multi fontstyle with dynamics properties, but I cann't do it.
Can someone teach me step by step how to do it?

Sorry for bad english, and I'm not programmer this is my first time to do something like this
 
What you want is not possible with a textbox. A textbox can only have one font and one style (bold, italic, etc) at any given time. You can't mix fonts or styles in the same textbox.

Also, this has got nothing to do with Dynamic properties. Those properties belong to a grid, not a texbox, and have a completely different use.

To achieve your goal, you would need to use a RichText control. This is one of the ActiveX controls that come with VFP. Using the RichText control is quite complicated, and would need a quite a lot more programming, as you would need to create further controls to let the use set and clear the various font settings. If you want to go down that path, I suggest you take a look at the control, and come back if you have any specific questions.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
@Mike Lewis

I'm sorry , I don't know that dynamics properties is nothing to do with it
and I already search about something use RTF format in foxpro but I don't understand it at all
How you add RTF format in report foxpro?
with Picture/OLE Bound Control ? but i can't find anything that said about RTF format
do you have step by step how to use Richtext control? or any video about that?

sorry if my answers and question seems stupid , but i'm 100% new at programming

thanks before and sorry for bad english
 
Mike surely misunderstands you, because you talk of reports and textboxes. When you talk about textboxes everyone will think of normal forms and controls. You mean a field:

Field_weup8b.png


The Dynamic Properties only work in REPORTENGINE 90 mode, so SET REPORTENGINE 90. Also provide the ReportOutput.app with your exe, or the reportmode also can't run and reverts to the runtime internal legacy reportbehavior.

Bye, Olaf.
 
Sorry, I missed that you were referring to reports. What I said about texboxes only applies to the textbox control (in forms and visual classes). You can of course use Dynamic properties in reports as Olaf pointed out.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
@OLAF
I already set the REPORTBEHAVIOR 90, I don't have any exe yet , so reportoutput.app isn't necessary right?
So with dynamics properties Can I set to text like this "This is to introduce James, birth date 12-12-1992" ?
I have a table with name and birth date
So how can I do it?

@Mike
Sorry for a bad explanations, I just know that in the report control it called field not text box


Edit : with this "This is to introduce" also get bold , not just James, how can I bold just the "James" with dynamics properties?
2_hkuucv.png
 
The dynamics also only give you control about the whole field. In fact boldness is controllable in the legacy mode, too, newer aspects are changing pen color and roation you can set in the advanced tab. Whatever you set here or in advanced isn't visible in the designer, it will be rendered in report preview (and of course the final print).

Bye, Olaf.

 
Maybe you have seen and forgotten this:
This feature is not a native VFP9 (SP2) feature, but needs the foxypreviwer modified report apps to work and thus also only works in VFP9, but dynamics prerties don't give control about every words formatting, how could they?

Bye, Olaf.
 
@OLAF

So is it not possible to do multiple style with dynamics properties?
sorry I don't really understand your answers
For that link I already see it before I know about dnyamics properties, but that is not working
I understand the part until add the html , where can I add the html code in the field?
below the <TF> part?

@mgagnon

where can I add RTF control in report?
and sorry again but I don't understand the link that you give, any english version about it?
 
I already read the FoxyPreviewer sample_tf report
and I still don't understand how can I add the code
From the sample_tf, its has a "TEXTO" field that already has user data = "<TF>", but there isn't any code in there , but if you print preview the report its has a code
html_1-tile_ditky0.jpg
 
Michael0025 said:
So is it not possible to do multiple style with dynamics properties?
Yes, I said:
dynamics properties don't give control about every words formatting, how could they?

That article says how to make use of foxypreviewer., I see you read it:
Michael0025 said:
where can I add the html code in the field? below the <TF> part?
No, the field properties user data only is <TF>, this just signals FoxyPreviewer to process tagged formatting (TF) - that's how this feature is called.
The tags (eg <b> for bold </b> for ending bold) have to go into your data, eg your expression should becomee "This is to introduce <b>James</b>, birth date <b>12-12-1992</b>" to get This is to introduce James, birth date 12-12-1992.

Bye, Olaf.

 
@OLAF

So with foxypreviewer we can get different style in 1 text

If we want to use html code we need memo field at the database table right?
I try to add this code :
This is to introduce <b>table1.name</b> , birth date <b>table1.birthdate</b>
What I get is this :
This is to introduce table1.name, birth date table1.birthdate

Table1 has name and birthdate data

So how can I change table1.name to James?
OR it is not possible to it with html code?






 
You either put "<b>James</b>" inside the name field or you use a report field with expression, but of course <b>table1.name</b> , birth date <b>table1.birthdate</b> wont' work, you need
[tt][highlight #FCE94F]"<b>"+table1.name+"</b>, birth date <b>"+table1.birthdate+"</b>"[/highlight][/tt], you need the report field expression to put together a string of tags mixed with the field content. You might want to use ALLTRIM(table1.name), too and you might need TRANSFORM(table1.birthdate) to turn the date into a string of the date.

As you use VFP9, you can also use easier to understand expressions putting everything into on TEXTMERGE() function call: [highlight #FCE94F]TEXTMERGE("<b><<ALLTRIM(table1.name)>></b>, birth date <b><<table1.birthdate>></b>")[/highlight], where << and >> mark the places Textmerge mixes in whatever partial expression inside. It's clever this is double brackets, as that is distinct from the single brackets used in tags, also in normal HTML tags. Note, you only have a limited set of tags as given in the article, not full HTML support.

Bye, Olaf.

 
@OLAF

Sorry if I miss something at here olaf
I try to write <b>"+table1.name"+</b> but its not return to James , but still it retrun to [highlight #EDD400]<b>"+table1.name+"</b>[/highlight]
and I try to use textmerge too, but it return to like this [highlight #EDD400]TEXTMERGE(<b><<ALLTRIM(table1.name)>></b>, birth date <b><<table1.birthdate>></b>)[/highlight]
Did i miss something?
Sorry if my question seems stupid, I don't really familiar with programing words

Edit : I already try another solution to get "James"
I try to replace table1.all(memo) with table1.name and at the field's expression I use : [highlight #EDD400]'This is to introduce'+table1.all[/highlight] to get [highlight #EDD400]"This is to introduce James"[/highlight]
But i think your solution will make it more easy than my solution
 
Really? You didn't copy the whole expression.The outer string delimiters are missing. You also didn't copy the TEXTMERGE expression correctly, again missing the string delimiters, here inside the brackets.

Concentrate.

report_expression_y5l82h.png


or

report_expression2_kyqhc6.png


This is just to illustrate with the limited area showing in the screenshot. The longer expressions highlighted above are what you need here 1:1.

Bye, Olaf.
 
where can I add RTF control in report?
and sorry again but I don't understand the link that you give, any english version about it?


I do not want to confuse this thread, sonce you seem to be looking into another way of do it.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
@OLAF

aah I already get it , I forget to change user data to <TF>
thank you very much for your solution olaf, its really resolve the problem


Do I need to create a new thread if I want to ask something again?
Cause I think I will have a problem with multiple page in 1 report file

EDIT : Can I use <TF> user data and <FJ> user data for justified and formating texts?
If can, how I do it?
 
It would be better yyou ask a new question, as that also gives new attention. The topic still is reports, but multipaging has toatlly normal solutions others know, too.
And in this thread , or in any thread having a forseeable solution, people offering an alternative may not follow anymore, so you always get best attention for a question with a separate threadd per question.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top