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

Thomas_J

Members
  • Posts

    6
  • Joined

  • Last visited

Thomas_J's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Changed Assigned User from - to @User_306070 Some additional information:I have had to implement these methods in the PHP Client myself, as they weren't implemented (for this reason?). I hope that these functions (or improvements on them) will be made available in future releases of the PHP Client. Unfortunately there is no project for the PHP Client, so I can't post this as a separate Feature Request. However, I hope that it is helpful for reproducing this issue. /** * This function retrieves all reports that are currently running. * It returns a list of running reports along with the executionId's. * * @param string $uri - Filter by report URI * @param string $user - Filter by owner of the report execution * @return SimpleXMLElement - XML construct containing running reports and the executionIds */ public function getRunningReports($uri = null, $user = null) { // Construct the url $url = $this->restUrl2 . REPORTS_BASE_URL . "?"; //TODO: Add the search parameters to the url (pending Jasper bug request #2834 - http://community.jaspersoft.com/jasperreports-library/issues/2834-1) //$url = $this->restUrl2 . REPORTS_BASE_URL . '?' . http_build_query(array('reportURI' => $uri, 'userName' => $user)); // Send the request to the server $data = $this->prepAndSend($url, array(200), 'GET', null, true); // Return the data as XML element $xml = new \SimpleXMLElement($data); return $xml; } /** * This function cancels a running report on the server. * It echoes the cancelled status back in an xml response. * * @param string $executionId - The executionId of the report to cancel * @return string - Confirmation of the cancellation */ public function cancelRunningReport($executionId) { // Construct the url and the page request body $url = $this->restUrl2 . REPORTS_BASE_URL . "/$executionId/status"; $requestBody = 'cancelled'; // Send the request to the server $data = $this->prepAndSend($url, array(200), 'PUT', $requestBody, true); // Return the raw response return $data; }
  2. I was hoping a more sophisticated solution would dawn, but alas, hopefully the following is of use to anyone in the future: I have now resolved this issue by moving the image directly to my web server, rather than embedding it in the report. In the iReport Designer I have set the ImageExpression property to point directly to this image (the image location surrounded with double quotes) and I have set the Is Lazy property to true to ensure that the image on my web server is referenced when the report is executed. I'm still a little worried that I have to go back and manually edit all my reports if my host address should change in the future, so if anyone can drop some hints on whether or not this can be made configurable, that would be much appreciated. Otherwise this solution works like a charm.
  3. Hi, I'm attemping to build a PHP client that displays HTML reports. My reports looks fine when they are exported to PDF, for example. Only when displaying the report in HTML format in the browser, the images are missing. I am using the PHP client provided on this site to fetch the report: $FullReport = $client->runReport($uri, 'html', null, $controls); I then dump out $FullReport to my browser, which produces the above issue. I noticed that the HTML references relative paths, so I have tried to point directly to the JasperServer resources, without any luck: $patterns = array(); $patterns[] = '/src='/'; $patterns[] = '/src="/'; $replacements = array(); $replacements[] = 'src='http://address:port'; $replacements[] = 'src="http://address:port'; $FullReport = preg_replace($patterns, $replacements, $FullReport); I also found that when I login in the browser directly, and then invoke the report, the images will show (because it fetches the images directly from the JasperServer, bypassing my Tomcat server): http://address:port/jasperserver/rest/login?j_username=jasperadmin&j_password=jasperadmin http://address:port/jasperserver/rest_v2/reports/reports/Sample/SearchStockReport.html?ItemCodeFilter=&ItemNameFilter= Moreover, when I do this within the same browser window, my above workaround does work! But it all depends on having logged in in the same browser window first. Can anyone provide any idea on how I can progress with this issue? Thanks
×
×
  • Create New...