Community
Showing results for 
Search instead for 
Do you mean 
Reply

Rich Text Field Issue

Copper Super Contributor
Posts: 61
Country: Australia

Rich Text Field Issue

I am attempting to create a custom report field by using VB to join Field1 & Field2 & Field3 etc.

 

All is great until I hit a Rich Text field such as Contact History Details. Then that part shows all the complex code behind the Rich Text.

 

Is there any way to read the plain text from this field or to convert the Rich Text to plain text?

 

Regards Brett Merriman

Brett Merriman
ACT! Certified Consultant
Action CRM
Platinum Elite Contributor
Posts: 6,652
Country: USA

Re: Rich Text Field Issue


Brett Merriman wrote:

 

Is there any way to read the plain text from this field or to convert the Rich Text to plain text?

 


 

 You have a double problem. No you can't extract the plain text from the RTF field. There is the further problem in that the field properties in the editor doesn't have a option for recognizing RTF in a custom field. The report engine will decode it but the editor doesn't directly provide the property. You'll also find another problem with custom fields, they don't have a property for Can Grow and Word Wrap.
 
 
Roy Laudenslager
ACT! Certified Consultant
ACT! Report Expert
Durkin Impact Report Designer
www.techbenders.com
royel@techbenders.com
541-343-8129
Copper Super Contributor
Posts: 61
Country: Australia

Re: Rich Text Field Issue

Thanks for the response Roy.

 

I solved the issue of extracting the contents as plain text by using a little string investigation loop.

if left(details1,1)="{" then for i = 1 to len(details1) if mid(details1,i,6) = "\fs17 " then j = i + 6 next i custom1 = mid(details1,j,len(details1)-j-8) endif

This stripped all of the RTF rubbish off the data I wanted (the last -j-8 removes the trailing RTF).

 

Now about your second comment...

Is it not possible to set the height of a field using VB? In VBA it is me.fieldname.height

 

 

 

Brett Merriman
ACT! Certified Consultant
Action CRM
Platinum Elite Contributor
Posts: 6,652
Country: USA

Re: Rich Text Field Issue

The code you listed is very interesting and would work provided the RTF coding was limited to setting the font for the whole entry. It the entry has additional for bolding, underscoring, fot changes, etc. I don't think the it would work to remove all the RTF code. However, it may be possible to come up with complex code that would strip all the RTF coding. Your code has given me something to thik about.

 

The report templates are coded in XML so yes, it is possible to modify a paramater value using some VB script. There are a couple of problems. The report engine assumes that if a required parameter isn't in the XML code, the default value is assumed. For the VB script to modify the value of the XML code, the parameter already needs to be listed. This often means that a required parameter must be set in the report editor to a non-default value to make sure it's included in the XML code. In the case of the custom fields, RYF, Can Grow, Can Shrink and Word Wrap aren't available in the report editor so there isn't any way to add the parameters via VB script. 

 

 

Roy Laudenslager
ACT! Certified Consultant
ACT! Report Expert
Durkin Impact Report Designer
www.techbenders.com
royel@techbenders.com
541-343-8129