-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rest v2 html images / charts are not showing up #1
Comments
Same here! |
1 similar comment
Same here! |
We both thureos and me are trying community version to see if it is the solution we are a searching for |
We are on ubuntu 13.04 x64, PHP 5.4.9, Using the bundled Tomcat server. Thanks |
Product Version: 5.2.0 |
Hey Guys, I figured out a way to get the images to work. Check out my example here: https://github.com/zacharyrankin/JasperReportsExamplePHP Let me know if it works for you and if you have any issues. Mariano, could you take a look at what I did and tell me if this is "right practice" or if there is a bug in the rest v2. Thanks |
Thanks Zachary, I tried it out but we are not using SSL so I tried this (DEMO Accounts): http://jasperadmin:jasperadmin@localhost:8080/jasperserver and no success Also I tried with this POST request, which if I paste into my browser it indeed logs in automatically, but I cant get any response. By the way, you have a script pointing to your domain. I dont know if you care about it, just let you know. Thanks so much! |
Thanks, I took it out and moved around the js to fix a weird error with jquery not being loaded yet. Couple of questions:
Thanks for trying it out. I am no expert on the jasper side of things, this was just how I was able to get it to work on my localhost. |
Looks like there are 2 slashes, don't put the first slash in your report_url. I need to make that better, let me know if it works if you change that.
|
Same result =( |
Wow, 😢 I wonder if it has something to do with passing parameters, the error is in the InputControlsContainer ... which is weird considering we are just trying to generate the report. Try setting parameters to |
Resource Not Found... My guess is that is all about Initial URL.. It doesn't log you in actually. I saw that you concatenate the auth url with the uri request. Maybe by separating them and making one to get JSESSIONID and another one to request the report. As I said in previous post the only URL that automatically logs me in is: But I cannot do this: Thanks for all your support |
I wouldn't think that it would work via the browser, but it should via curl, try this, you should get results from this:
|
I think I got it... I changed URL to in both report.php and report_asset.php to: Illuminate\Jasper::$url = 'http://localhost:8080/jasperserver/'; and in line 79 of IlluminateJasper.php return "/rest_v2/reports/{$this->report_url}.{$this->format}?j_username=jasperadmin&j_password=jasperadmin&{$url_params}"; PDF and HTML works but XLS has no images. Obviously user and password are coded right in it, we can store it into a variable and make it more ellegant. We will continue testing it. Thanks so much |
Sweet, well good news. I am not sure why the basic auth doesn't work for you, but at least you got it, nice work! The one thing I would suggest is passing the j_username & password in as parameters so you don't have to modify the IlluminateJasper.php, e.g.,
As for XLS, we have never seen graphs or charts in the xls, and we have used the software since it was using SOAP...so it could be a bug in the jasper renderer or just something that is not supported in xls...which someone from Jasper will have to weigh in on. Hope all goes well, glad I could help |
It worked! We will polish it and adapt it to our need. While waiting for @marianol to give us some news... Thanks again @zacharyrankin |
Hey awesome that you have found a fix for this, I have been swamped so I was not able to touch this project in quite some time. Anyway I have some good news regarding the images in the XLS export, that is actually a configuration setting, if you want the XLS to have the chart image just open WEB-INF/applicationContext.xml and search for the xlsExportParameters bean and in there you will find: <property name="ignoreGraphics" value="true"/> Set that to false and your charts will be exported as images in XLS |
Hi Guys, I have abstracted this logic into a more reusable library that you can use: https://github.com/zacharyrankin/Douglas let me know what you think. |
Cool, thanks!
|
Hello. I don't know if that might be related or not... There is a known bug/deficiency in Report Executions service that replaced Reports service in 5.2, I believe. Currently Reports service implicitly uses Report Executions in synchronous mode, and that you can tell by /reportExecutions/ path segment in report attachment URLs like in the first message. The known deficiency is that Report Executions flow is not stateless. To work correctly it requires that the cookie JSESSIONID is the same for the request to create report and request to fetch attachments. Authentication with the same credentials either via basic http or parameters in URL will not work — the resources won't be found if the cookie doesn't match. The correct way to get a report and its attachments using the client would be to get both the report and the attachments using the client and the same cookie (will probably require writing a method to get attachments). If it's required to then display this report to the user, your PHP application should retrieve from JRS and serve both report and attachments. In order to not have to perform str_replace on the output to replace default attachment paths (rest_v2/reportExecutions/{executionId}/exports/{exportId}/attachments/), you may use attachmentPrefix parameter upon running a report/execution to specify custom prefix (e.g. rest_v2/reports/reports/samples/AllAccounts.html?attachmentPrefix=http%3A%2F%2Fmyphpapp.com%2Freports%2Fattachment.php%3F%3D) And actually I'd advise you to look at Report Executions service. It's described in Web Services Guide. It requires more steps to perform, but allows to get valuable metadata mid-air. |
Hi Actine, Could you take a look at https://github.com/zacharyrankin/Douglas. I use the /rest_v2/reports/sample_report.html?parms_1=etc which from the docs is using the reportExecutions. Are there problems using this or should I just use the reportExecutions instead? Thanks so much for your help, and for the information on the attachmentPrefix, I will give it a try. |
Hi Mariano!
It has been a while, how are you doing?
I was trying out the new stuff using the rest_v2, and the images are coming back from the jasperserver looking like:
/jasperserver-pro/rest_v2/reportExecutions/1448340476_1378856082848_7957/exports/html/attachments/img_0_0_55
I added a simple string replace to make them look like this,
https://<server>:<port>/jasperserver-pro/rest_v2/reportExecutions/1448340476_1378856082848_7957/exports/html/attachments/img_0_0_55
but still no luck, resource not found.Here is our version information
Am I doing something wrong or maybe I need to go and re-request those from the server? Thanks so much for any help.
The text was updated successfully, but these errors were encountered: