jaspersoft_313 Posted April 17, 2023 Posted April 17, 2023 For our Project we are developing a web app consisting of a TypeScript Frontend and Java Backend. In this app, the user has the option to request a report. The report is generated by Jasper Server v7. To get access to the required data, we have added a JSON-DataSource to the Jasper Server, which uses the REST-API of our Java Backend. When we call the Jasper Server, we use a few request parameters, which in turn are also used for the JSON-DataSource.To create the DataSource, we have to use default-parameters for the request parameters. If we just keep the fields empty, it just throws an error and doesn't let us continue. Our problem is, whenever we request a report now, our backend is called two times, first with the default parameters we used when we set up the report, an then with the parameters we send to request the report. Is there any way to prevent the first "default" call? Everything is functioning correctly, but the unnecessary request just creates more load on our server, which we want to reduce. Our JasperSoft Studio Version is 6.12.2 (we use this version on purpose, since the newer versions lead to other problems).
anish.rai Posted April 17, 2023 Posted April 17, 2023 Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times.
Badr Draifi Posted April 17, 2023 Posted April 17, 2023 Hi jaspersoft_313, could you please provide more info on the error that you encounter when you create your JSON datasource with the default params ? You should be able to create your DS without any default params. Please share the error logs and the screen shots of how you're setting your DS. Thanks
jaspersoft_313 Posted April 17, 2023 Author Posted April 17, 2023 Hi bdraifi,you're right, the json datasource doesn't require default params, I misremembered. But even if I don't use default params, our backend still gets two requests from the jasper server, first an "empty" request and then the request with the correct url-parameters, so the problem stays the same
dany.isenguerre Posted April 17, 2023 Posted April 17, 2023 Hello, we had to found a workaround for that.We added a parameter called "ping" with true as default valueThe defaut values are used in that stange first call.In the backend, if "ping"is true, we return a success and no valueThen, we call the data forcing "ping"to false to get the real valueThis is very strange, it seems this first call is a "hey, do you live ?" called with /inputcontrol urlI hope it will hepl
dany.isenguerre Posted April 17, 2023 Posted April 17, 2023 Hello, we got the same problem 3 or 4 years ago and we had to found a workaround for that.We added a parameter called "ping" with "true" as default valueIt seems the defaut values of the parameters are used in that stange first call.In the backend, if "ping"is "true", we return a success and no value.Then, we call the data forcing "ping" to false to get the real valuesThis is very strange, it seems this first call is a "hey, do you live ?" called via the /inputcontrol url. That's why we called that dummy parameter "ping"I hope it will help Dany
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now