Jump to content
Changes to the Jaspersoft community edition download ×

Parameter Problems


2005 IR Help

Recommended Posts

By: ddelong01 - ddelong01

Parameter Problems

2005-08-10 08:22

I have a strange problem with parameters. I am using iReport to design my report, that has 1 parameter. When I include a default value for my parameter, and preview in iReport, everything is fine (i.e. When I key in various values for the parameter, the report shows with the expected records each time). However, when I run the report in my application, I only get the recordset which corresponds to my default parameter, even when I specify a different parameter value at runtime.

 

If I omit the default paramater in my .jrxml file, I get a blank page when I preview my report.

 

My parameter is named 'visitid' and is used for determining a particular invoice number for the invoice report I am trying to generate. As I mentioned, I can preview the reports fine in iReport, but invoice #116 is the only one that shows up when I run the report in my application. Here is a snippet of the jrxml file:

 

<parameter name="visitid" isForPrompting="true" class="java.lang.Integer">

<defaultValueExpression ><![CDATA[new Integer(116)]]></defaultValueExpression>

</parameter>

<queryString><![CDATA[sELECT *, (tax1+tax2) as taxtotal, (item_quantity * item_cost) as itemtotal FROM CompanyInfo, patient, Billing, Breakdown where ((patient.id = Billing.pat_num) and (Billing.visit_num = Breakdown.visit_num) and (Billing.visit_num = $P!{visitid})) group by Breakdown.id]]></queryString>

 

Here is how I am calling the report:

http://localhost:8084/test/build/web/rptInvoice.jsp?visitid=109

 

However the result is always the same as if I do this:

http://localhost:8084/test/build/web/rptInvoice.jsp?visitid=116

 

I've tried recompiling the report each time I run it (which I don't believe is necessary), and various other options for the past 2 days. I've also searched through this forum and the JasperReports forum without finding a solution. Can anyone please help?

 

Thanks,

Dan

 

 

 

 

By: ddelong01 - ddelong01

RE: Parameter Problems

2005-08-10 12:10

Ah nm, its solved...it was combination of changing from an integer to s string, and also defining it in the 'Map parameters' section of my jsp file.

 

:)

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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...