Search code examples
jasper-reportsjasperserver

JasperReports parameters works in iReport but fails on JasperReports Server (II)


I have a very similar problem to the one described at [JasperReport parameters works in iReport but fails on JasperServer] post.

The report works properly within the iReport environment using Preview option but fails within JasperReports Server

The comments suggest that iReport does not create the InputControl within JR Server. So I verified that the server contained the proper InputControl (that apparently solved their issue).

The input control called sk serial selection :

ID: ic_sk_serial
Name: sk serial selection
Type: Single Select Query
Mandatory: false
Read Only: false
Visible: true
Query resource: 
    From repository (pointing to *q_sk_serial* see below)
Value and Visible columns:
    Value column: id
    Visible query columns: serialnr  

The input control query called q_sk_serial (populate the inpute control with a list of alphanumeric serial numbers, items are unique):

select id,serialnr from "public"."serials" order by serialnr;  

The parameter name:

ic_sk_serial  

The report query:

select * from "public"."datas" datas where datas."serialnr" like $P{ic_sk_serial}   

In my case, input control seems to work properly in both environments (within iReport preview and JasperServer): I populate a list of items coming from the same database; I see that dropdownlist as expected within iReport but also on with JR Server.

Within iReport, the drop-down list returns the correct selected value in a report parameter which lead to the correct report. In JasperReports Server I only get a "The report is empty" message. So I tend to think the report parameter is not properly passed through within JasperServer.

Hardcoding the "Input control" output value, shows expected report.

Side note: I am using iReport 4.7.1 in compatibility mode with JasperReports Server 4.5.0.

I would be glad to hear if anybody ran into the same problem?

How can I debug further the report execution in JR Server?

Is compatibility mode susceptible to cause that issue?

What about the input parameter type? I use a query that return a string. However my input data type is text (closest match to string). My parameter type is java.lang.string. Does this make sense?


Solution

  • Actually that is a simple bug:

    I just found out that:

    value column: id  
    

    Should be

    value column: serialnr  
    

    Still, I do not understand why the report was working in preview mode? Such big mistake should fail on preview no?

    In anycase thanks to everybody to lead to my mistake ;)