Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
3425 Weergaven

Hi everyone,

 

I would like to know if it is possible to color just a part of a field in an RML report.

I have a "big" field that contrain a long text. I would like to just color a part of the field (Titlle of some part of my text).

I try some html command like <p> for bold inside the field but it doesn't works. RML considere it like text and not like command.

If someone has an idea, it can help me a lot!

Thank you,

 

Aurélien Briand

Avatar
Annuleer
Auteur

Or maybe it is impossible? It mean that I need to create multiple field?

Beste antwoord

Hello Selverine,

use this code for color format in rml report

<para textColor="red">
            this paragraph has red color.
</para>

also try this code

<para textColor="blue">
      This paragraph has been styled, but not using the stylesheet.
      It just uses style attributes inside it's own &lt;para&gt; tag.
</para>

 

if you find this answer helpful, please give me a thumbs up vote    

Regards,

Ankit H Gandhi

Avatar
Annuleer
Auteur

Hi Ankit, Thank you for your answer. However , I have the impression that with this I will have a color for all the field. However I want just a part of the field ( It is a long test and I want to put a color just on the title and some worlds). If I put this inside my field, it will work? Thank you, Selverine

@ Selverine: you can put your field inside the para tag itself. so it will affect only on that field.

Auteur

@Ankit. My field is a long text. I want just the beginning of my field in a red color. But the last part of the field I want it black. With this I will have or all my field red or all black no?

Auteur

Maybe I was not clear but my field is a field that I get from database. It is not a text in rml file

If you can determine how long the TITLE is, or if it is delimited somehow, you can break the field into 2 parts (string operation in python) and the put the first part in the coloured para and the next part in the black para.

Auteur

Hum not bad idea. I don't know how long but I can maybe find a specific word. I suppose it is possible too with Python. Thank you for the tips!