Jump to content
We've recently updated our Privacy Statement, available here ×

matthias.budde

Members
  • Posts

    9
  • Joined

  • Last visited

matthias.budde's Achievements

  1. Unfortunately, the bearer token is in the header, not the body in my case. I don't see a way to read it from there at the moment... Once I have it, passing the token to retrieve the JSON is relatively straight forward: You create a parameter, let's call it "auth_token" and then you open the report's "Dataset and Query Dialog". There, you switch to the "Data Adapter" tab, in which you select the "Headers" tab. There, you create a parameter named "Authorization" and assign the auth_token parameter as value. If you assign a valid bearer token als value for the auth_token parameter, the GET request is properly authenticated. This part works perfectly for me. Hope that helps!
  2. Is it possible to read a parameter from a response header of a web request? I need to retrieve JSON data from a REST API that requires token based authentication. So before I pull the actual JSON data, I will need to retreive an authentication token with a separate REST call. Unfortunately, the response to this call delivers the token not in the body of message, but in the Authorization header. Is there any way retrieve this info from a Jasper report and store it as a parameter so that the second REST call can use it? Or, alternatively, can JasperReports Server somehow make such a request and use it as an input control?
  3. Just an addition to the answer from I am Leo, because I had some similar problems recently. If your Studio version is < 6.10.0, you need to use <textField isStretchWithOverflow="true">[/code]instead. For versions >= 6.10.0 it needs to be <textField textAdjust="StretchHeight">[/code]
  4. I am unsure whether this solves your problem, but for my own (see comment above), it was a matter of wrong expectations combined with a wrong user. I assumed http://<host>:<port>/jasperserver[-pro]/rest_v2/reports was supposed to list all reports, but that is not the case. Similarly, I believe http://:/jasperserver[-pro]/rest_v2/reportExecutions only shows the reports that are actually currently executing, not those scheduled to do so. Eventually it did work for me after using the correct requests and creating a new user with the role ROLE_USER (see also my answer to my problem at https://community.jaspersoft.com/questions/1163826/reports-rest-request-yields-empty-response-jasperreport-server)
  5. Ok, it seems I got it all wrong. I assumed that GET http://<host>:<port>/jasperserver/rest_v2/reports would list all reports, as that was my expectation from working with other REST APIs. This assumption was wrong. After playing around and reading the manual more carefully than before, I eventually got it right. The things that triggered the 403 access denied when trying my approach in the comment above were (a) that I got the URL wrong (missing "reports/") and (b) that I forgot the file extension (.pdf in my case) GET http://<host>:<port>/jasperserver/rest_v2/reports/<foldername>/<reportname>.pdf did the trick. I still don't get why this can only be done by a user (ROLE_USER) and not an admin (ROLE_ADMINISTRATOR), but that is not a practical issue for me. (EDIT: Apparently the whole user thing was some kind of bug. After repeating the whole procedure on a fresh server, the admin user can access the reports same as the regular user.)
  6. If you are in a current Jasper version, I would assume <printWhenExpression><![CDATA[iF(OR(NOT(A),NOT(B)),true,false)]]></printWhenExpression> substituting A and B appropriately.
  7. I seem to be getting a bit closer. I noticed that under http://<host>:<port>/jasperserver/rest_v2/resources the reports were not listed as well. So I created a user (with ROLE_USER) and tried this one for the REST requests. Now, the reports are listed under http://<host>:<port>/jasperserver/rest_v2/resources at least. Still, http://<host>:<port>/jasperserver/rest_v2/reports yields an empty response body with status code 204. But now, when I try to directly GET a report via http://<host>:<port>/jasperserver/rest_v2/<foldername>/<reportname> I suddenly get an "Access is denied" response with status code 403. Before, with the admin user, I received a 404. Seems I made some progress, but I am still stuck. All permissions to reports and the full folder tree are set to RWD* for ROLE_USER. Really not seeing the issue here...
  8. I am running a fresh Jasperserver CE in docker (bitnami image). I can interactively log into the server and create a test report (without data adapter) that successfully runs. However, using the REST API, whenever I request http://<host>:<port>/jasperserver/rest_v2/reports, I get an empty response with HTTP status 204 (no content). Other resources, such as login, logout, or http://<host>:<port>/jasperserver/rest_v2/resources yield meaningful results. So the REST API works correctly in principle. My request is properly authenticated with the credentials of an admin user. The report was built in Jaspersoft Studio 6.13, JasperReports Server version is 7.5. What am I missing? Is there some configuration change necessary so that reports can be listed via REST?
  9. I have the same issue. I am running a fresh Jasperserver CE in docker (bitnami image). I can interactively log into the server and create a test report that successfully runs. However, using the REST API, whenever I request http://<host>:<port>/jasperserver/rest_v2/reports, I get an empty response with HTTP status 204 (no content). Other resources, such as login, logout, or http://<host>:<port>/jasperserver/rest_v2/resources yield meaningful results. So the REST API works correctly in principle. Is there some configuration change necessary so that reports can be listed via REST?
×
×
  • Create New...