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

How to show jpeg in pdf report + OpenERP 7

By
Yulybaseball
on 8/14/14, 12:15 PM 1,091 views

Hi there,

I am using aeroo to generate reports in OpenERP 7. I want to show a jpeg image in the report. I have this .odt  template:

<for each="o in objects">

<o.student_ids.image>

 

<o.faculty_id.name>

</for>

o.student_ids is the current row from the model I want to retrieve image from. Image is a BLOB in PostgreSQL database. This code only returns the bin code of the image, showed all in the pdf report. I tried to convert the image in a phisical one and passes it to the report using a function in the Parser(report_sxw.rml_parse) class, but I only received this text in the place the image should go:

<PIL.JpegImagePlugin.JpegImageFile image
mode=RGB size=249x202 at
0x7FC54C920F80>

I tried some other "solutions" I found in the web, but none of them worked for me.

I tried this other code in .odt template:

[[ o.student_ids.image and setTag('para','image',{'width':'80.0','height':'80.0'}) ]] [[ o.student_ids.image ]]

and it showed this error:

"Aeroo Reports: Error while generating the report.
list indices must be integers, not list..."

Then I tried this code in .odt template:

[o.student_ids.image and setTag('para','image',{'width':'80.0','height':'80.0'}) ] and [ o.student_ids.image ]

And it showed the pdf report with this text in the place the image should be appeared:

browse_record_list(1)

And so on... I really tried many many codes, but no one worked for me.

In .odt template (LibreOffice) I allways select Image Format when writing the code.

Please, how can I show the image in the report??

Cheers in advance.

 

 

 

0
ahmad
On 8/15/14, 7:56 AM

You should insert frame, then please refer to the following link for more details

http://www.alistek.com/wiki/index.php/Template_Directives#Frame

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: 8/14/14, 12:15 PM
Seen: 1091 times
Last updated: 3/16/15, 8:10 AM