Jump to content
We've recently updated our Privacy Statement, available here ×

How isForPrompting works?


apx1sharma

Recommended Posts

I'm new to Jasper reports.

Can anyone help me explaining how isForPrompting works? I have a Java program as below:


----------------------------------------------------------

jasperReport = JasperCompileManager.compileReport("sample_report.jrxml");

// filling report with data from data source
jasperPrint = JasperFillManager.fillReport(jasperReport,jasperParameter, connection);

// exporting process
JasperExportManager.exportReportToPdfFile(jasperPrint,"sample_report.pdf");

----------------------------------------------------------

The JRXML file contains a parameter as shown below:

<parameter name="Comments" class="java.lang.String" isForPrompting="true">
<parameterDescription>
<![CDATA[Please type here the report comments, if any]]>
</parameterDescription>
</parameter>

 

However while running my program, It never says or prompt for any run time parameter. When I click on report generated by Java program (that's a PDF file) it doesn't promt for any parameter.

I don't know what I'm missing here? I would like to know how this parameter can be used, specially how the program will throw a prompt to end user?

 



Post Edited by apx1sharma at 08/05/2010 04:08
Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

I believe the forPrompting parameters are used for iReport and JasperServer so the user is forced to enter in data to dynamically run the report. When doing it programatically I think the expectation is on the programmer to add the parameters in. The API lacks comments on this variable so I cannot determine that, but based on what I've seen that is what I believe to be true.
Link to comment
Share on other sites

Thanks for reply.

 

I too have observed, the IReport window prompt for input for parameter with "isForPrompting" attribute set to true. However in regular Java program (one shown above) i don't see that.

 

also I don't see any use of this parameter, because the usable report will be generated in most cases in one of the commonly available format HTML, PDF, EXCEL etc...and not IReport custom window.

 

 

Link to comment
Share on other sites

Yep. I have seen this used as a convenience parameter only. That is, it will only be used in systems designed to take advantage of it (e.g. iReport and JasperServer) but will be ignored otherwise. Maybe java programs are intended to check for that forPrompting to be set and the programmer manually do something to handle the parameter in that instance. This is just speculation, but based on what I've seen in the past I am betting that is it.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...