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

crRTFText , how use this function???

Status
Not open for further replies.

joe69008

Programmer
Jun 29, 2005
42
FR
hi everybody,

Please someone can explain me how to use this function
i try crRTFText(database field) but crystal give me a error.

i have a clob text like that {\rtf**.... and i want in a formula convert this text in rtf format to have a good text.

i try "crRTFText({ACLOB.CLOB_0})" but it's no good.
i also try "if {ACLOB.CLOB_0}[1]<>" " then crRTFText "


If some one have an idea, i will very grateful

thanks

regardless
 
You say but it's no good, when instead you should state why it is no good. Do you receive an error, or the formatting is wrong, or?

You can just place the field in a Crystal section, and right click it, select format field->paragraph->text interpretation and select RTF.

-k

 
thanks for your answer,

When i said , it's not good, it was means CR tell me an error. Excuse me for precise this.

if not, i do like you said but the problem is this field is in subreport and i want to bring it in main report.
and when i do "select format field->paragraph->text interpretation and select RTF" in my formula
which are

"shared stringvar clob0;
clob0:= {ACLOB.CLOB_0} ;"

this wasn't work and the values are alwas in incomprehensible caracter.

Thanks again.
 
Try converting the clob to a varchar using a SQL Expression, and then use it.

I just posted the conversion here, I'll assume that this is the same person/issue.

-k
 
I can't modify the database so I can't convert clob to vachar.
According to you, cstr(clob-field) will work?

thanks for your answers.
 
That has nothing to do with modifying the database.

I suggest that you hire a contractor.

-k
 
Excuse for not understand what you said before. So if that has nothing to do with modifying the database, when you said using a SQL expression, that meant with crystal report?
That's right?

and excuse for my mistake expression but I don't speak very english.

thanks again.

Best regard
 
Depending upon your datasource and your connectivity, you might have SQL expressions available to you within Crystal Reports. In the subreport, go to the field explorer->SQL expression->new and try entering something like {%clob}:

{fn convert(ACLOB.`CLOB_0`,SQL_VARCHAR)}

Then change your subreport shared variable to:

whileprintingrecords;
shared stringvar clob0;
clob0:= {%clob};

Then when referencing the variable in a formula in the main report, go to format field->text interpretation->RTF text.

I can't really test this, but it's worth a try.

-LB
 
hi everybody,

Lbass, i have just tried your formula and Crystal give me the error :
"error while compilation, 42000[data direct][ODBC Oracle driver] sql_varchar is not a valid ODBC SQL type for convert"

Someone Know where the error come from?

Thanks.

Best regard
 
Dear Joe,

You have to use syntax appropriate for your database. You have not told us the database you are reporting against the odbc driver you are using, nor which version of Crystal.

Your english is not a problem it is the lack of enough information. When you post a question, the very best thing to do is to post all relevant information at the same time:

Database
Version of Crystal
ODBC driver

Then, if possible, with the information provided, we may be able to help.

Best regards,

ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
hi Rosemary,

thanks for your invaluable advice, your are right and i am sorry for not have been precise since the beginning.
I will be it for the next time;).

so, the database is Oracle 9i.2, the crystal report version is 10 ans as for the ODBC drivers , I don't know! (how can we get this information?)

I thought the sql function "SQL_VARCHAR" in the expression sql formula : "{fn convert(ACLOB.`CLOB_0`,SQL_VARCHAR)}"
was for all database. there is an another sql function for Oracle?

Thanks again
Best regards.
 
If your field has rich text inside it, just move it around like a normal set of string data.

When you want to display it on the page, use "Format Field" and text interpretation and select RTF.

Be careful manipulating text inside or around the RTF values. It is very fussy. For example a simple thing like a blank line before the rest of the text will not be interpreted correctly.

Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top