Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Place image in body of report

By
Aitor Bouzas
on 1/20/15, 7:11 AM 739 views

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

1
Yogesh
On 1/20/15, 7:34 AM

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>

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

Aitor Bouzas
on 1/20/15, 7:40 AM

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

Aitor Bouzas
on 1/20/15, 7:41 AM

nice, Stephen's answer was for qweb :)

Yogesh
on 1/20/15, 7:46 AM
1

Stephen Mack

--Stephen Mack--
5023
| 8 8 9
Santiago, Chile
--Stephen Mack--

Some people call me a karma whore, I only ask for 10 points if you like my answer and 15 if I happen to get it correct.

Stephen Mack
On 1/20/15, 7:24 AM

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:..."/>

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

Aitor Bouzas
on 1/20/15, 7:27 AM

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

Aitor Bouzas
on 1/20/15, 7:33 AM
0

Ivan

--Ivan--
3210
| 5 3 6
Jakarta, Indonesia
--Ivan--
Ivan
On 1/20/15, 7:41 AM

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.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/20/15, 7:11 AM
Seen: 739 times
Last updated: 3/16/15, 8:10 AM