On Sat, Oct 18, 2014 at 3:10 PM, Bounmy Sihaphom <[email protected]>
wrote:

> On Tue, Oct 14, 2014 at 5:55 AM, Sebastián Marró <[email protected]>
> wrote:
>
>> Hi Bounmy
>>
>> 2014-10-12 20:34 GMT-03:00 Bounmy Sihaphom <[email protected]>:
>>
>>> Hi all!
>>> I am trying to print number of daily appointments from the Tree view to
>>> odt file, it gives me the internal server error 500, here is my genshi code
>>> on the file:
>>>
>>>
>>>
>>> <for each="appointment in objects">
>>>
>>>     <for each="appointment in appointment">
>>>
>>>            <appointment.appointment_date_time>,<appointment.ref>,
>>>
>>>            <appointment.patient>, <appointment.sex>, <appointment.age>
>>>
>>>      </for>
>>>
>>> </for>
>>> My target model :
>>> class AppointmentReportbm(ModelSQL, ModelView)
>>> ...
>>> appointment = pool.get('gnuhealth.appointment').__table__()
>>> ...
>>> If I took the internal loop out, it prints only the first record from
>>> the list, in this case, how can i define the second loop so that I can
>>> print all the records from the list?
>>>
>>
>> I think you can delete the internal loop. Normally the objects variable
>> it's a list with all the selected records from the tree view [0]. Have you
>> tried selecting the records before printing the report?
>>
>> By the way, i believe that the AppointmentReportbm model definition is
>> not needed and only if you want to pass custom data to a report, you have
>> to define a class that inherits from Report [1]
>>
>> Regards !
>>
>> [0]
>> http://doc.tryton.org/3.2/trytond/doc/topics/reports/index.html?highlight=report#accessing-models-from-within-the-report
>> [1]
>> http://doc.tryton.org/3.2/trytond/doc/topics/reports/index.html?highlight=report#passing-custom-data-to-a-report
>>
>>
> Thanks Sebastián, I will try.
>
>> --
>> Sebastián Marró
>> *thymbr**@*
>> Converging Ideas for Emerging Realities
>> www.thymbra.com
>>
>
> Hi Sebastian!
I did try, select all records inthe tree view and took out the inner loop,
it works, but it does not print

<appointment.patient> correctly, it prints   gnuhealth.patient,12 instead,
do I need some function? in the view it print the name of a patient
correctly, but not on odt file.

Actually, I would like to print to odt file without highlighting
(selecting)  records on the view, so what would I use in the loop?

Thanks for your help.

Reply via email to