Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4723 Lượt xem

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.

 

 

 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 9 17
5442
2
thg 9 17
6194
1
thg 8 15
4547
3
thg 8 15
13957
0
thg 3 15
3482