0
votes

I am trying to generate a jasper report using jasper server. I have uploaded the created report to server and created a parameter and an input control named roomId

When I am calling report with a value, it works. But when the roomId is null, report is empty. Means it does not even have table headers.

<parameter name="roomId" class="java.lang.Integer">
    <defaultValueExpression><![CDATA[]]></defaultValueExpression>
</parameter>
<parameter name="roomIdTemp" class="java.lang.String" isForPrompting="false">
    <defaultValueExpression><![CDATA[$P{roomId} == null ? "" : " AND T.ROOM_ID_01 = "+ $P{roomId} + " "]]></defaultValueExpression>
</parameter>

Calling url http://localhost:8081/jasperserver/flow.html?...... to generate report.

I am new to jasper reports. Can you please tell me whether this is illegal or not. Or am I missing anything.

1

1 Answers

0
votes

I got the answer from somewhere else

I am using $P{parameterName} It won't work if I am passing an empty string or null.