[#12351] - JRParameter getDescription is always null

Category:
Bug report
Priority:
Urgent
Status:
Closed
Project: Severity:
Major
Resolution:
Works as Designed
Component: Reproducibility:
N/A
Assigned to:
0

hi ,
I want to import the parameters description in java code and I get always null value . Example :

in jrxml file :
<parameter name="input0" class="java.lang.String">
<parameterDescription><![CDATA[bla bla]]></parameterDescription>
</parameter>

in java code:

logger.debug("found text params name...... " + param.getName() + " parameter description " + param.getDescription() + " is for prompting " + param.isForPrompting());

output :

found text params name...... input0 parameter description null is for prompting true

Does the description attribute value is passed or not ? I have tried more type of parameters and I get always null . There is something wrong in jrxml source maybe ?

Thank in advance

v7
jasper library
someUser's picture
Joined: Sep 7 2011 - 1:09pm
Last seen: 5 days 8 hours ago

10 Comments:

#1
  • Assigned:nobody» shertage
#2
  • Status:New» Feedback Requested

Hi,

please post the JRXML sample file and the entire Java code snippet, in order to help us to reproduce the issue.

Thank you.

#3
  • Resolution:Open» Unable to Reproduce
#4

I have already added example or jrxml file and java log. Is about passing any prompted parameter description from jrxml to java code . The description is null .

JRParameter[] params = jasperReport.getParameters();
for (JRParameter param : params) {
logger.debug("params name...... " + param.getName() + " parameter description " + param.getDescription() + " is for prompting " + param.isForPrompting());

}

AttachmentSize
Binary Data jasperexample.jrxml1.98 KB
#5

Hi,
we tested the jasperexample.jrxml sample and got correct values for input0 and input1 parameter descriptions. Attached are jasperexample.jasper (the compiled report) and jasperexample.jasper.jrxml (the re-decompiled report) files. You can see that parameter descriptions were preserved from the initial jasperexample.jrxml sample file to jasperexample.jasper.jrxml decompiled version.
The jasperexample.jasper and jasperexample.jasper.jrxml were generated using the specific ant 'compile' and 'decompile' tasks available in the JR library samples distro.
Anyway, how did you obtain the jasperReport object in the Java code? Did you use JasperCompileManager or JRXmlLoader class?

Thank you,
Sanda

AttachmentSize
Binary Data jasperexample.jasper17.95 KB
Binary Data jasperexample.jasper.jrxml1.87 KB
#6

JasperCompileManager

#7

I have extracted a part of code :

```
File initialFile = new File(jrxmlPATH + reportFile);
InputStream targetStream = new FileInputStream(initialFile);
JasperDesign jasperDesign = JRXmlLoader.load(targetStream);
JasperReportsContext reportsContext = new SimpleJasperReportsContext();
JRPropertiesUtil.getInstance(reportsContext).setProperty(JRCompiler.COMPILER_PREFIX + JRReport.LANGUAGE_JAVA, JRJdtCompiler.class.getCanonicalName());
JasperCompileManager jasperCompilerManager = JasperCompileManager.getInstance(reportsContext);
JasperReport report = jasperCompilerManager.compile(jasperDesign);
```

#8

We have made tests on our side and there does not seem to be anything wrong with this property.
If you are in control of this application you are developing, then maybe you can perform some debugging and if the problem persist, you could maybe point us to where the problem is in our library, if any.
You can have the source code of the library and thus debugging on your side should not be a problem.

Thank you,
Teodor

#9
  • Resolution:Unable to Reproduce» Works as Designed

Ah sorry, indeed is working , I was using jrxml file from a different branch. Sorry for the time spent to solve this. I promise to check well in the future when I will be back to you with something :) .
Thanks a lot for help and patience , you can close this ticket. ,

#10
  • Reproducibility:Always» N/A
  • Status:Feedback Requested» Closed
Feedback
randomness