Exception: Invalid cell value type version 7.0.56

35 views
Skip to first unread message

Yeoresley Dominguez

unread,
May 28, 2025, 12:36:12 PMMay 28
to Jam.py Users Mailing List
Good afternoon, everyone. I hope you're all well.

Please help me with this error I'm getting when printing a report, specifically on this band. If I disable it, the report prints without a problem, but I need that part.


error.png

Greetings

Yeoresley

Fabio Lenzarini

unread,
May 28, 2025, 3:41:26 PMMay 28
to Yeoresley Dominguez, Jam.py Users Mailing List
Can you share the report code?

Ciao
Fabio 

--
You received this message because you are subscribed to the Google Groups "Jam.py Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jam-py+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/jam-py/6fc22f61-d9ac-4e8a-a839-520ce5a4bec4n%40googlegroups.com.
Message has been deleted

Yeoresley Dominguez

unread,
May 31, 2025, 3:54:28 AMMay 31
to Jam.py Users Mailing List
report code here


def on_generate(report):
    enti = report.task.cla_entidad.copy()
    enti.open()
    guia1 = report.task.aut_eval.copy()
    guia2 = report.task.aut_eval.copy()
    tit = report.task.dci.copy()
    uni = report.task.cla_unidad.copy()
    uu = str(report.id_unidad.value)

    tit.set_where({'id__eq': report.diagnostico.value})
    tit.open()
    if report.niv.value == 1 :
        guia1.set_where({'id_dci__eq': report.diagnostico.value ,'tipo__eq':1})
        nta = 'Aspecto Evaluado'
    if report.niv.value == 2 :
        guia1.set_where({'id_dci__eq': report.diagnostico.value ,'tipo__le':2})
        nta = 'Tema / Aspecto Evaluado'
    if report.niv.value == 3 :
        guia1.set_where({'id_dci__eq': report.diagnostico.value,'tipo__le':3})
        nta = 'Norma / Tema / Aspecto Evaluado'
    if report.niv.value == 4 :
        guia1.set_where({'id_dci__eq': report.diagnostico.value})
        nta = 'Componente / Norma / Tema / Aspecto Evaluado'
       
    area = tit.area.display_text
    nod = tit.numero.display_text
    estado = tit.estado.display_text


    entidad = 'Razón social: '+ enti.reup.display_text + '-'+enti.razon.display_text
    direccion = 'Dirección: '+enti.res.display_text
    otros = 'Correo:'+enti.cor.display_text + ' Telefónos:'+enti.tel.display_text
    report.print_band('title', locals())

    guia2.open(
        where={'id_dci__eq': report.diagnostico.value ,'tipo__eq':1},
        funcs={'medaso': 'sum','evalua': 'sum'}
        )
       

    guia1.open()

    for a in guia1:
        if a.tipo.value == 3:
            nnn = a.codigo.display_text + ':'+ a.preguntas.display_text
            report.print_band('detail', locals())
        if a.tipo.value == 2:
            tem =  a.codigo.display_text + ':'+ a.preguntas.display_text
            report.print_band('detail_a', locals())
        if a.tipo.value == 1:
            cuestionario = a.codigo.display_text + ':'+ a.preguntas.display_text
            if a.evalua.value == 0:
                respuesta = a.evalua.display_text
            if a.evalua.value == 1:
                respuesta = '✔️ ' + a.evalua.display_text
            if a.evalua.value == 2:
                respuesta = '✘ ' + a.evalua.display_text
            if a.evalua.value == 3:
                respuesta = '❌ '+   a.evalua.display_text
            fej = a.fej.display_text
            respondido = a.respondido.display_text
            if a.com.value :
                fundamenta = 'R:/ ' + a.com.display_text
            else :
                fundamenta = ''
#        else :
 #           con = ''
            report.print_band('detail_b', locals())
            if a.causas.value :
                con = '⇨ Causas: ' + a.causas.display_text
                report.print_band('detail_c', locals())

    total = tit.total.display_text
    por = round((tit.positivas.value + tit.negativa.value) / tit.total.value * 100,1)
    obs = 'Para el presente diagnóstico se ha previsto evaluar un total de '+\
         tit.total.display_text +' preguntas, de las cuales se han evaluado '+\
        str((tit.positivas.value + tit.negativa.value)) +' que representa el '+str(por)+'%, de ellas '+ tit.positivas.display_text +' se han respondido positivamente y '+\
        tit.negativa.display_text +' negativamente, asociándose '+\
        guia2.medaso.display_text +' medidas a las no conformidades u otra situación no favorable detectadas.'
    ptos = guia2.evalua.value
    pre = tit.total.value
    vci = round(ptos / pre,2)
    if vci < 1:
        vpto = 'Evaluaciones Insuficientes'
    if vci >= 1  < 1.67 :
        vpto = 'Adecuado'
    if vci >= 1.67  < 2.33 :
        vpto = 'Parcialmente adecuado'
    if vci >= 2.33 :
        vpto = 'Inadecuado'

    report.print_band('resumen', locals())
   
    uni.set_where({'id__eq': report.id_unidad.value})
    uni.open()
#    guia2.open(
#        where={'master_rec_id__eq': report.diagnostico.value, 'causas__ne':'' },
#        group_by=['causas']
#        )
#    for c in guia2:
#        cau = '⇨' + c.causas.display_text
#        pp = c.codigo.display_text
#        report.print_band('causas', locals())
   
    ela = report.ela.value
    apro = uni.mru.display_text
    report.print_band('pie', locals())

Dean D. Babic

unread,
May 31, 2025, 7:35:50 AMMay 31
to Jam.py Users Mailing List
And the report file please.

Yeoresley Dominguez

unread,
May 31, 2025, 10:58:12 AMMay 31
to Jam.py Users Mailing List
autoc.ods

Dean D. Babic

unread,
May 31, 2025, 11:06:06 PMMay 31
to Jam.py Users Mailing List

This will be hard to since u are using Spannish and Windows. 
The best is to try small project with ONE field and see.
Also, which version Libre Office? You need to povide all this info man, 101 of IT troubleshooting....

Dean D. Babic

unread,
Jun 1, 2025, 8:45:22 AMJun 1
to Jam.py Users Mailing List
If I add this to Invoice for Demo:
    subtotal = invoices.subtotal.display_text
    tax = invoices.tax.display_text
    total = invoices.total.display_text

    obs = 'Para el presente diagnóstico se ha previsto evaluar un total de '+\
             subtotal +' preguntas, de las cuales se han evaluado '+\
            subtotal +' que representa el '+subtotal+'%, de ellas '+ subtotal +' se han respondido positivamente y '+\
            subtotal +' negativamente, asociándose '+\
            subtotal +' medidas a las no conformidades u otra situación no favorable detectadas.'
    print(obs)
    report.print_band('summary', locals())
    report.print_band('resumen', locals())    

and add to Invoice.ods at the bottom:

resumen
 %(obs)s


It prints well:
Screenshot from 2025-06-01 20-40-48.png

And in console:

127.0.0.1 - - [01/Jun/2025 20:43:58] "POST /api HTTP/1.1" 200 -
Para el presente diagnóstico se ha previsto evaluar un total de $6.93 preguntas, de las cuales se han evaluado $6.93 que representa el $6.93%, de ellas $6.93 se han respondido positivamente y $6.93 negativamente, asociándose $6.93 medidas a las no conformidades u otra situación no favorable detectadas.
127.0.0.1 - - [01/Jun/2025 20:44:01] "POST /api HTTP/1.1" 200 -
127.0.0.1 - - [01/Jun/2025 20:44:01] "GET /static/reports/invoice_2025-06-01_20-44-00.582309.pdf HTTP/1.1" 200 -

Yeoresley Dominguez

unread,
Jun 1, 2025, 8:00:21 PMJun 1
to Jam.py Users Mailing List

Ok, I'm going to correct this, because something strange is also happening to me. I have Libre Office 7.0.4 installed and now I installed 7.0.2, but it's not generating the PDF reports, it only generates them in ODS. I have version 7.0.56 of jam.py installed with Python 3.12.7, and that report worked fine in Jam.py 5.

Thank you for taking the time to support us.
Thank you and best regards.

Dean D. Babic

unread,
Jun 2, 2025, 3:01:35 AMJun 2
to Jam.py Users Mailing List
I think this is a problem for Windows:

I reverted the change and released 7.0.57, and tested it. See pics.
This is Win11, Python 3.12.5

Try it and see how it goes...
yer_01_jampy.png
yer_02_jampy.png

Yeoresley Dominguez

unread,
Jun 2, 2025, 10:40:31 AMJun 2
to Jam.py Users Mailing List
OK, take the tests, thanks and greetings
Reply all
Reply to author
Forward
0 new messages