Jump to content
Changes to the Jaspersoft community edition download ×

Regression with 3.7.1 about parameter content


Gaby38

Recommended Posts

 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

Link to comment
Share on other sites

  • Replies 11
  • Created
  • Last Reply

Top Posters In This Topic

 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

Link to comment
Share on other sites

  • 2 months later...

 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
Link to comment
Share on other sites

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?

 

 

Link to comment
Share on other sites

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