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 suppress blank rtf field

Status
Not open for further replies.

brendanchris

Technical User
Nov 24, 2006
7
AU
Hi all

I have an rtf memo field coming across into a crystal report.I have turned on the rtf interpretation and the field displays just fine.

The dilemma is however that I wish to suppress the field if the rtf interpreted display is blank. When I turn on suppress if blank as I normally do, it doesn't suppress the field, I assume because in the actual field in the table, there is still rtf code sitting there. So what I want to try and do is suppress if the result of the rtf interpretation is blank. At the moment it leaves a whole lot of blank lines through the report.

Any ideas would be greatly appreciated.


Cheers

Brendan
 
Is the rtf coding standard throughout? If there is a constant number of codes, you could use a suppression formula like:

len({table.field}) = 7 //or whatever the constant result is

Or, if it varies, but if there is a standard way of extracting the text from the codes, you could use that to design a suppression formula.

-LB
 
Hi lbass.

Thanks for you comments. I had thought that may be a way around it, but is is difficult to see a standrard paatern in the rtf code for those with text data and those without. Here are some examples:

With text:
EXAMPLE 1
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs17 Still wine.
\par }

EXAMPLE 2
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Verdana;}}
\viewkind4\uc1\pard\lang3081\f0\fs15 Entries in this class should be inspired by form. Artistic content depends on creating and raising awareness of form rather than a lifelike representation.
\par }

EXAMPLE 3
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 MS Sans Serif;}{\f1\fswiss MS Sans Serif;}}
\viewkind4\uc1\pard\lang3081\f0\fs17 Charolais, Murray Grey and Hereford Bulls\lang1033\f1
\par }

Here is an example of one without text:
EXAMPLE 1
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs17
\par }


I thought maybe doing some sort of suppression formula that says if the field contains "\fs??" followed by a space and then something other than "\par }" then don't suppress.

I tried this using:
lookslike({qryClassBC.DescriptionRTF},"*\fs?? \par }") to try and return a true or false but I must have somtheing wrong as it is returning all trues for the examples above.


Any ideas on what sort of formula might work here would be much appreciated.


Cheers

Brendan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top