Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3 Antwoorden
5511 Weergaven

Hi,

Is there anyway to place an image inside the body (<story>) of a rml report? I know how to add it in <pageGraphics> but <image file="http://localhost:..." /> doesn't seem to work...

Thanks in advice

Avatar
Annuleer
Beste antwoord

you can try, it works well !
<tr>
        <td>
          <illustration height="65.0" width="480.0">
              <image x="-20" y="-5" file="path_to_image/logo.jpg" height="80.0" />
           </illustration>
        </td>

</tr>

Avatar
Annuleer
Auteur

Same as @Stephe Mack's answer... No error but doesn't work.

Auteur

Sorry, I had an error, it's working now!! Thanks! :)

nice, Stephen's answer was for qweb :)

Beste antwoord

There was a presentation on the reporting engine QWeb by Simon Lejeune during the 2014 Opendays (Video | Notes).  Also more information on QWeb can be found in Odoo's 8.0 Documentation.

I believe you want to use: <img t-att-src="http://localhost:..."/>

Avatar
Annuleer
Auteur

That's about V8... I'm using V7...

Auteur

I tried it, there's no error but nothing seems to show... I checked the image url and it's ok...

Beste antwoord

If you haven't change the RML Header setting in the Company, you can find example there.  The image tag can only accept images that are stored in database.  Example in the standard RML Header is: <image x="1.3cm" y="27.7cm" height="40.0" >[[ company.logo or removeParentNode('image') ]]</image>, which takes the company's logo stored in the database.  If you need images other than the Company's Logo, you can attach it to ir.attachment and use setHtmlImage.  Here is the explanation of setHtmlImage: setHtmlImage(id, model=None, field=None, context=None),  returns the value of field as specified by given database id in the given model.  If model is not specified, it will return the value of field datas of ir.attachment.  Or, alternatively you can use report_webkit's ir.header_img and make use of it's get_logo_by_name method to obtain the image by name.

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
mrt. 15
4193
1
mrt. 15
6713
0
mrt. 15
4074
1
mrt. 15
8867
1
mrt. 15
4299