I have a dataset that returns a BLOB field (thats how BIRT has binded in the table). In the database the data type is classified as Long Raw, so i need to transform the binary data to text using a generic convert function.
The problem is that BIRT appears to not recognize embedded RTF expressions after the conversion, but maybe im doing something wrong.
I was using a Dynamic Text component that contains the data converted in the Expression Builder property. Also, the content type of that field is set to RTF.
Here is how BIRT shows
{\rtf1\ansi
\ansicpg1252\deff0{\fonttbl{\f0\fnil MS
Sans Serif;}{\f1\fnil\fcharset0 MS Sans
Serif;}}
\viewkind4\uc1\pard\qc\lang1046\b
\f0\fs16 1 x\f1\'ed\-cara de leite
\par 1 colher de sopa de fermendo em p
\'f3
\par 3 x\'ed\-caras de farinha de trigo
\par 3 x\'ed\-caras de a\'e7\'facar
\par 3 ovos
\par 4 colheres de margarina\b0\f0
\par }
As we can see, the text contains RTF tags mixed with the main content.
The idea is to make birt delete the tags or be able to model them in some way.
Here is how i was expecting the output
1 xícara de leite
1 colher de sopa de fermento
3 xícaras de farinha de trigo
After some research there is a possible answer, but is not the perfect one because the goal was to model in some way the RTF tags. Here it is:
The firs step os to convert the binary data
The next step is to delete all RTF tags using regex. This solution was based on this post: Regular Expression for extracting text from an RTF string .
It is important to note that the accents are treated individually.