Hi there, I have literally been using Jasper for a few days now and so far I like a lot.
I am testing out some of the features, but am struggling to get date parameters to work with an sql stored procedure.
The report query is Execute sp_MyProcedure $P{@In_Start}$P!{@In_End}$P{@In_Skill}
I have set up teh parameters and they are set to timestamp for @In_start & @In_End and string for @In_Skill
The fields cannot be found by the query, i get the following error - Error executing SQL Statement for null check username and password
If I modify the stored procedure to remove the start and end date parameters and adjust the jasper parameters then the query works, but I need it to include date parameters.
Does anyone have any suggestion what I might be doing wrong?
1 Answer:
Hi grant.king,
See the problem which I see here is that the parameters you gave in the stored procedures, are not initialized thats why they tend to give NULL POINTER EXCEPTION so for that you could give the default value of the parameters as -1 for the numeric parameters or " " for the text parameter .
Next problem which I see could be problematic is the sequence of the parameters in the parameter list . suppose there are two parameters P1 and P2 they are defined in the sequence P1 and then P2 but in the stored procedure the parameter P2 is used before P1... then that will give an error in SQL.
So please check for above things and let me know if it helps
Thanks and Regards,
Ankur
Thanks Ankur
I have set the default values of the parameters to be -1 and "" as suggested and also checked that the parameters run in the same order as they do in the stored procedure.
I had already got the report to run in ireport even before your suggestions, however when I try to run the report through the repository navigator it does not return any results regardless of what dates I enter.
When I try to run the report on jasper Server, the calendar selector does not allow me to select dates and when I try to enter them manually, it says I am not entering a valid data type
http://community.jaspersoft.com/questions/808677/jasper-server-date-para...