Jump to content
  • Jaspersoft Studio broken with java.util.Date parameter


    erickdeoliveiraleal
    Assigned User chicuslavic
    CategoryBug report
    PriorityNormal
    ReproducibilityAlways
    ResolutionFixed
    SeverityMinor
    StatusResolved
    Versionv5.6.1

    I have a report that works fine in iReport Designer but in Studio it shows me an empty page. If I take off the line where parameter $P{DATA} is used the report works fine.

     

    SELECT

    INTERNO.NOME_INTERNO,

    INTERNO.RGI,

    INTERNO.tempo_consolidado_ano,

    interno.tempo_consolidado_mes,

    INTERNO.tempo_consolidado_dia,

    INTERNO.REGIME_ATUAL,

    PAVILHAO.PAVILHAO,

    GALERIA.GALERIA,

    CELA.CELA,

    SOLARIO.SOLARIO,

    COALESCE(DESTINO.destino,'NÃO INFORMADO') DESTINO,

    agenda_atendimento.data_agenda,

    agenda_atendimento.hora_agenda,

    c.cidade,

    UNIDADE_PENAL.NOME_UP,

    UNIDADE_PENAL.sigla,

    case agenda_atendimento.id_up

    when '104' then (select nome_funcionario from funcionario WHERE FUNCIONARIO.id_funcao= 401 AND FUNCIONARIO.id_up = 104)

    when '105' then (select nome_funcionario from funcionario WHERE FUNCIONARIO.id_funcao= 401 AND FUNCIONARIO.id_up = 105)

    when '106' then (select nome_funcionario from funcionario WHERE FUNCIONARIO.id_funcao= 401 AND FUNCIONARIO.id_up = 106)

    when '107' then (select nome_funcionario from funcionario WHERE FUNCIONARIO.id_funcao= 401 AND FUNCIONARIO.id_up = 107)

    when '308' then (select nome_funcionario from funcionario WHERE FUNCIONARIO.id_funcao= 401 AND FUNCIONARIO.id_up = 308)

    when '309' then (select nome_funcionario from funcionario WHERE FUNCIONARIO.id_funcao= 401 AND FUNCIONARIO.id_up = 309)

    when '408' then (select nome_funcionario from funcionario WHERE FUNCIONARIO.id_funcao= 401 AND FUNCIONARIO.id_up = 408)

    when '3010' then (select nome_funcionario from funcionario WHERE FUNCIONARIO.id_funcao= 401 AND FUNCIONARIO.id_up = 3010)

    else 'CampoBranco'

    end as NOME_CHEFE_NUARQ,

    'CHEFE DA NUARQ' AS CHEFE_NUARQ,

    case agenda_atendimento.id_up

    when '104' then (select nome_funcionario from funcionario WHERE FUNCIONARIO.id_funcao= 501 AND FUNCIONARIO.id_up = 104)

    when '105' then (select nome_funcionario from funcionario WHERE FUNCIONARIO.id_funcao= 501 AND FUNCIONARIO.id_up = 105)

    when '106' then (select nome_funcionario from funcionario WHERE FUNCIONARIO.id_funcao= 501 AND FUNCIONARIO.id_up = 106)

    when '107' then (select nome_funcionario from funcionario WHERE FUNCIONARIO.id_funcao= 501 AND FUNCIONARIO.id_up = 107)

    when '308' then (select nome_funcionario from funcionario WHERE FUNCIONARIO.id_funcao= 501 AND FUNCIONARIO.id_up = 308)

    when '309' then (select nome_funcionario from funcionario WHERE FUNCIONARIO.id_funcao= 501 AND FUNCIONARIO.id_up = 309)

    when '408' then (select nome_funcionario from funcionario WHERE FUNCIONARIO.id_funcao= 501 AND FUNCIONARIO.id_up = 408)

    when '3010' then (select nome_funcionario from funcionario WHERE FUNCIONARIO.id_funcao= 501 AND FUNCIONARIO.id_up = 3010)

    else 'CampoBranco'

    end as NOME_DIRETOR_DE_PENITENCIARIA,

    'DIRETOR DE PENITENCIÁRIA' AS DIRETOR_DE_PENITENCIARIA

    FROM INTERNO

    INNER JOIN PAVILHAO ON (INTERNO.IDPAVILHAO = PAVILHAO.ID_PAVILHAO)

    INNER JOIN GALERIA ON (INTERNO.IDGALERIA = GALERIA.ID_GALERIA)

    INNER JOIN CELA ON (INTERNO.IDCELA = CELA.ID_CELA)

    INNER JOIN SOLARIO ON (INTERNO.IDSOLARIO = SOLARIO.ID_SOLARIO)

    INNER JOIN agenda_atendimento ON (INTERNO.id_interno=agenda_atendimento.id_interno)

    INNER JOIN agenda_situacao ag ON (ag.idagenda_situacao = agenda_atendimento.idagenda_situacao)

    LEFT JOIN destino ON (destino.id_destino=agenda_atendimento.iddestino)

    LEFT JOIN cidade c ON (c.id_cidade=destino.idcidade)

    LEFT JOIN UNIDADE_PENAL ON (UNIDADE_PENAL.ID_up=INTERNO.id_UP)

    WHERE INTERNO.ST = 'A' AND INTERNO.ID_UP = $P{UNIDADE}

    AND DATA_AGENDA=$P{DATA}

    and ag.descricao not like 'CANCELADO'

    ORDER BY agenda_atendimento.hora_agenda, c.cidade, destino.destino, INTERNO.NOME_INTERNO

     

    The parameter $P{DATA} is a java.util.Date type and works fine in iReport Designer. But with Jaspersoft Studio it shows a empty report. I already checked if the parameter were filled, I already changed the parameter type to Timestamp. But nothing happens.



    User Feedback

    Recommended Comments

    Changed Assigned User from - to @User_306070


    If I replace $P{DATA} by '2014-09-01' it works nice! Also in a new test I created a parameter "DataString" and i just entered "2014-09-01" then the console shows Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]please remove this checking, this is so annoying
    Link to comment
    Share on other sites

    Changed Assigned User from @anonymous to @chicuslavic


    if you want date (no time) the type is java.sql.Datejava.util.Date and java.sql.Timestamp are timestaps date+timewidget show time in 12-hour format, so 00:00 from 24 hour format is the same with 12:00 AMI'll look how to improve the widget, maybe we should have a preference for time format
    Link to comment
    Share on other sites


×
×
  • Create New...