Regression with 3.7.1 about parameter content

 Hi,

I use in a query a parameter $P{CLSH} wich is got at execution time from a single select list Input Control.

One of the possible content of this parameter is :

substr(lib_nom_lie,1,decode(instr(lib_nom_lie,'('),0,length(lib_nom_lie)+1,instr(lib_nom_lie,'('))-1)

(that allows me to change the grouping level of the query by playing with the part of the field "lib_nom_lie" taken into account)

I use it in the query as follows :

select $P!{CLSH} .........

Till now no problem : this was working fine.

Since the 3.7.1 Jasperserver release, when I select the parameter input of the list corresponding to the value listed above, nothing happens : no error, but I remain on the parameter window. If I select another value for the parameter in the list, all is OK. If I test my query with this value outside Jasperserver on the same database (with sqldevelopper) , all is working well with the right results.

I tried to change the value by deleting the single quotes inside the parameter :

"substr(lib_nom_lie,1,decode(instr(lib_nom_lie,(),0,length(lib_nom_lie)+1,instr(lib_nom_lie,())-1)"

Of course this is crazy from sql point of view but if I click on "OK", then jasperserver launches my query and I get an "SQL execution error" that is normal according to my modification.

So, it seems that something has changed with the new release of Jasperserver in the parsing of the input parameters ( introduction of cascading input controls??).

Can anybody help me to fix this point : how to escape the single quotes in a parameter in Jasper. I tried with antislash. I tried also to put "\\Q')'\\E (found in the net). But nothing worked.

Thanks for any suggestion

Gaby

Gaby38's picture
4413
Joined: Mar 22 2008 - 1:49am
Last seen: 15 years 6 months ago

11 Answers:

 More Info,

In fact, when I said it was not working when I tried to escape the single quote with a backslash, I was wrong : jasperserver launched the report but there was a SQLM execution error. When I write 

\\')\\' in the input control

jasperserver accepts  and launches the report but I get  "  \\')\\'  " inside the parameter value. So I have to eliminate the backslah caracters with a  ".replace("\\\\","").

I have tested and it works. So in my report I have a first parameter which maps the input control, and I have another parameter to be used in the query which has as default value the first parameter.replace("\\\\","").

It works fine.

But perhaps have you a smarter method ??

So thanks for your future suggestions.

Gaby

Gaby38's picture
4413
Joined: Mar 22 2008 - 1:49am
Last seen: 15 years 6 months ago

This has been fixed after the JS CE 3.7.0 release.  See the changes in rev. 16755 at http://jasperforge.org/scm/viewvc.php/branches/js-for-pro-3.7.x/jasperserver-war/src/main/webapp/WEB-INF/jsp/DefaultParametersForm.jsp?root=jasperserver&r1=16882&view=log

You can merge the changes to your version of the file.

Regards,

Lucian

lucianc's picture
87025
Joined: Jul 17 2006 - 1:10am
Last seen: 13 hours 7 min ago

 

I downloaded from your link the new jsp file for the parameter window and it is now working as before.

Thanks a lot Lucian

Gaby38's picture
4413
Joined: Mar 22 2008 - 1:49am
Last seen: 15 years 6 months ago
Is this likely to work in the CE version? I have downloaded and copied the file in the place of the original, and it broke the whole server!

Do I need something else? What am I missing?

Your help much appreciated.
tmochan's picture
353
Joined: Jun 12 2009 - 3:56am
Last seen: 4 years 10 months ago

 Hello,

I use jasperserver CE. So when I wrote that I downloaded and that was working fine, it was with jasperserver CE..

As far as I remember there was no special thing to take care of.

Gaby38's picture
4413
Joined: Mar 22 2008 - 1:49am
Last seen: 15 years 6 months ago

Just to clarify,

You are running JasperServer CE 3.7.0 ?

You downloaded "DefaultParametersForm.jsp"

and put it in \\apache-tomcat\\webapps\\jasperserver\\WEB-INF\\jsp

Anything else?

tmochan's picture
353
Joined: Jun 12 2009 - 3:56am
Last seen: 4 years 10 months ago

 Yes,

The original size of "DefaultParametersForm.jsp" is 22150 and the size of the new downloaded is 22839.

Since the download, all has become as previous.

 

I forgot : you have to restart jasperserver



Post Edited by Gaby38 at 07/15/2010 20:26
Gaby38's picture
4413
Joined: Mar 22 2008 - 1:49am
Last seen: 15 years 6 months ago

Have done that and experimented a bit more ... the three options in "Controls Layout" for each report are :

  • Pop-Up Window
  • Seperate Page
  • Top of Page

I would normally have used "Top of Page", as I adjust and rerun reports using the web interface regularly.

Having now successfully installed the fix that was mentioned by Lucian (thanks), and also updates to

  • ReportTopInputControls.jsp (2,937kb)
  • ReportTopParametersForm.jsp (25,027Kb)
  • FillParams.jsp (4,294Kb)
  • ViewReport.jsp (8,226Kb)
  • ViewReportControlsDialog.jsp (5,683Kb)
  • DefaultParametersForm.jsp (22,839Kb)

After these updates, I checked with each of the methods in turn, and only the "Seperate Page" works when I have apostrophes in the parameters.  "Pop up window" and "Top of Page" both don't - still!

Any ideas?

 

 

tmochan's picture
353
Joined: Jun 12 2009 - 3:56am
Last seen: 4 years 10 months ago

I take that back (slightly).

"Pop Up Window" now works, but my preferred "Top of Page" still doesn't!!!

 

Also found and installed a newer version of DefaultParametersForm.jsp (29,251Kb)



Post Edited by tmochan at 07/16/2010 11:05
tmochan's picture
353
Joined: Jun 12 2009 - 3:56am
Last seen: 4 years 10 months ago

tmochan
Wrote:

"Pop Up Window" now works, but my preferred "Top of Page" still doesn't!!!

Log a bug for that, we'll have to look into it.

Regards,

Lucian

lucianc's picture
87025
Joined: Jul 17 2006 - 1:10am
Last seen: 13 hours 7 min ago
tmochan's picture
353
Joined: Jun 12 2009 - 3:56am
Last seen: 4 years 10 months ago
Feedback
randomness