Combining Field With Data Source Follow

0
Avatar
Legacy Poster

Greetings,

 

Problem:  I need a field on my label to look like this:

Directions: blah blah blah blah

 

Data from datasource: blah blah blah blah

 

Right now, my data doesn't have the word "Directions:" but if I have to add the value I can.  I'd prefer not to.

I am pulling from a datasource, and I do understand VB.

Set directions = Objects("Directions")

 

What would be the best method to solve this problem, and what is the correct syntax?

I tried using a wordprocessor field and a RTF field, but I couldn't figure out how to make it work.

I was thinking of concatenating "Directions:" with directions.value, but that didn't seem to work

6 comments

0
Avatar
Ian Cummings
Moderator
Comment actions Permalink

I guess you want to create two data sources in the one text object.  Then in the fonts properties of the object you can set a font per data source should you want the text label to be in bold, with the database field in regular.  The below training videos should be helpful:

 

https://youtu.be/TLR9qJ7iB44

 

https://youtu.be/FRcASc2CnD4

0
Avatar
Legacy Poster
Comment actions Permalink

Thanks!  The 2nd video was very helpful.  Solved my tasks.

0
Avatar
Legacy Poster
Comment actions Permalink

Hi 
I have verry similar problem but with a twist. I have text object with multiply data sources something like
size: A B C
One of the data source's text need to be bigger. I can't configure from font per data source dialogue because it's different data source every time.
The data source that need to be bigger is determine in the VB script that I wrote, but I can't find any way to make the font bigger.
is there a way to change data source font from VB script? or any other solution?
0
Avatar
Ian Cummings
Moderator
Comment actions Permalink

tempt: Yes you can do this in VB script.  Take a look at the following white paper: http://www.seagullscientific.com/media/101557/dynamically-changing-objects-at-print-time-using-vb-script.pdf

 

The property you'd want to adjust is the FontSize property I guess: http://help.seagullscientific.com/2016/en/#../Subsystems/BTVBScript/Content/so_tmplt_FontSize_Property.htm

0
Avatar
Legacy Poster
Comment actions Permalink

Thanks for the fast replay.
The second link explain how to change fontsize but it limited to objects, only the text field is an object, all the data source aren't objects hence can't be modified.
 
"Sizes" is the text field, s1,s2,s3 are the data sources.
 
Format.Objects("Sizes").FontSize = 16
 
Format.NamedSubStrings("s1").Value = a
Format.NamedSubStrings("s2").Value = b
Format.NamedSubStrings("s3").Value = c
 
As you can see I can change the fontsize of the object "Sizes" among other properties, but the only thing I can change about data sources is the value.
 
The only way I found to change data source's font is in the "font per data source" dialogue, I need to change the font from the VB script.
0
Avatar
Ian Cummings
Moderator
Comment actions Permalink

temp: Sorry then, I think you're out of luck as we cannot affect this on a per data source basis programmatically.  Have you considered using a mark up language container object instead that uses RTF or HTML as part of the data source.  In this way you can adjust the style of the text in addition to the value data sources.

Please sign in to leave a comment.