Focal Point
[CLOSED]CLOB with Rich Text Format

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7897008976

December 15, 2015, 07:54 AM
TonyB
[CLOSED]CLOB with Rich Text Format
I have a report which needs to display an Oracle CLOB. The CLOB contains RTF-code. It concerns field CONTENT (record in masterfile see below)

FIELD=INTERACTIONID ,INTERACTIONID ,P10 ,P10, MISSING=OFF,$
FIELD=U_VERSION ,U_VERSION ,A1 ,A1, MISSING=OFF,$
FIELD=MODIFIEDBY ,MODIFIEDBY ,A10 ,A10, MISSING=OFF,$
FIELD=MODIFIEDON ,MODIFIEDON ,YYMD ,DATE, MISSING=OFF,$
FIELD=CONTENT ,CONTENT ,TX50 ,TX, MISSING=OFF,$

This field may contain all kind off formatting and codes like \tab and \par etcetera.
Is there a possibility to display this field in a Report like it would display in Microsoft Word?
Apart from the CLOB the report also has to display the "normal" fields.

In this forum I've SEARCHed for CLOB and TX and I've already tried to convert the format to A4000, but nothing does the trick

Field CONTENT contains (example):
quote:

{\rtf1\ansi\ansicpg1252\deff0\deflang1043{\fonttbl {\f0\fnil\fcharset0 Arial;}{\f1\fnil Arial;}} \viewkind4\uc1\pard\fs20 Sales-meeting met Koen de Graaf en Teun Hoefnagel (beiden werkv. ber. van dit project.)\par Projectlrider \tab Bart van de Hoef\par uitvoerder \tab Michel Schoenmaker \tab M 06 22 05 37 65\par \par Werkadres van dit project is Middelstestraat 77 Weert\par \par Project is geen BIM\par \par Prijzen:\par 1e verd. A \tab AVU32 \tab\'80 35,75/m2\tab levering week 10\par dak A \tab\tab AVU32\tab\'80 34,50/m2\tab levering week 15\par \par De prijs is vast t/m 31-12-2016\par \par 1e verd. A dak 3580+\tab A260\tab 31,50/m2\tab levering week 10\par 1e verd. A dakterras \tab A260\tab 34,75/m2\tab levering week 10\tab\par dak A\tab\tab\tab A260\tab 32,70/m2\tab levering week 15\par \par Prijzen zijn incl. KH; KD en CS\par \par Betalingen tussen de 30 en 45 dagenaannemer betaald in de week na 30 dagen op een vast tijdstip en is daardoor voor 45 dagen bij VBI binnen.\par \par Def. tekeningen komen in week 50 naar VBI.\f1\par }

This message has been edited. Last edited by: <Emily McAllister>,


WebFocus 8.0.3
Windows 7 Prof
Oracle 11.2.0.3
Output PDF and Excel
December 16, 2015, 09:19 AM
stur0063
I was not able to figure this out in webFOCUS - so I got a little creative.

I created a frame in my webFOCUS HTML page. I then used some JavaScript to populate the frame. The JavaScript calls some .NET code I wrote that takes the keys needed to pull the clob/blob (data looks just likes your example) and sticks it into a System.Windows.Forms.RichTextBox control. The RichTextBox control I then convert to HTML.

It's not as elegant as I'd like - but it works.

If you have the ability to do some .NET - let me know and I'd be happy to send a code example.


webFOCUS 8207.15
WindowsServer 2019
December 17, 2015, 08:04 AM
TonyB
Thank you for this response.

But it doesn't solve my problem. The question I've raised is only part of it. I need to use extra fields (not CLOB) in my report.

The following code:

quote:
DEFINE FILE XXXXXX
CONT_A/A4000 = CONTENT ;
END
TABLE FILE XXXXXX
PRINT
CONT_A
WHERE INTERACTIONID = &INTID ;
ON TABLE SET PAGE-NUM OFF
ON TABLE SAVE AS '&INTID.EVAL.RTF'
END
-RUN


saves only the field CONT_A as a document with extension .RTF

Double-clicking in Windows opens it correctly in MS Word (with all its "make-up", tabs etc).

But when I include other fields in the PRINT , the result still has the RTF-extension, but it isn't recognized as such and it becomes plain text:

quote:
PRINT INTERACTIONID AS ''
CONT_A
WHERE INTERACTIONID = &INTID ;


The result opens in MS Word (partial, the ID is placed before the RTF-code):

quote:
4065932{\rtf1\ansi\ansicpg1252\deff0\deflang1043{\fonttbl{\f0\fnil\fcharset0 Arial;}{\f1\fnil Arial;}}
\viewkind4\uc1\pard\fs20 Sales-meeting met Koen de Graaf en Teun Hoefnagel (beiden..


It's just plain text

Suggestions, anyone?


WebFocus 8.0.3
Windows 7 Prof
Oracle 11.2.0.3
Output PDF and Excel
December 21, 2015, 05:36 PM
<Emily McAllister>
Hi TonyB,

I don't know of any way to do something like this. As you are probably aware, we do not at present have an adapter that will produce Word documents with formatting. What you are doing now is kind of an interesting workaround - since the CLOB field is written in Word's formatting - but I'm not surprised that the addition of other fields is throwing it off.

My only suggestion would be to see if you can get the rest of the report's formatting to match Word's formatting. Is it possible to break up the content in the CLOB into several pieces - one chunk for the part before your other field(s) are meant to go, and the other chunk to follow? If it's included like the rest of the text it might continue to recognize it as Word format.

I hope that helps you.

Sincerely,
-Emily McAllister
Focal Point Moderator