Jump to content
Changes to the Jaspersoft community edition download ×

PHP Web Service runReport parameters


the478guy

Recommended Posts

I'm trying to run a report with PHP, the PHP sample included does not work on my server. I'm using NuSOAP for PHP.

 

What are the parameters that need to be sent to the runReport service to run a basic report?

 

Where can I find this information, the web services guide is not clear about this.

 

Regards,

Chris

Link to comment
Share on other sites

  • Replies 13
  • Created
  • Last Reply

Top Posters In This Topic

I'd strongly advise you to get the PHP sample working if you want to get the web services approach working. We did, although the code appears to be written for PHP4 and so raises notices and requires a bit of enabling legacy stuff in php.ini. I've not heard of NuSOAP, I used the standard SOAP library in PEAR.

 

Once you have that working, the rest is fairly plain sailing. You could indeed use the PHP-Java bridge, but we don't have a Java installation on our live web server, and in any case I much prefer having reporting functionality on a different server.

 

One gotcha that we ran into was wanting to pass connection parameters in the SOAP request to be used with the report. It turns out that this, for the time being at least, is not implemented. However we worked out a reasonably elegant workaround, which I will describe here if anyone is interested.

Link to comment
Share on other sites

Set these, either in your virtualhost, or across your whole php.ini:

 

php_flag register_globals on

php_flag register_long_arrays on

 

Standard disclaimer: your mileage may vary. See what warnings/notices are output by PHP, and respond accordingly. Btw rather than saying "the sample still won't run", it would be more useful to describe what error messages you are encountering, either on-screen on in the logs.

Link to comment
Share on other sites

Ok, I've not got the example to display me the login page. However, when I try my details in, the form posts to itself, but has no error or message. There are some undefined vars in the error_log. I think it's a register_globals issue but I have this enabled in php.ini and also the two lines you gave me, can these go anywhere in the php.ini? For example I have:

 

register_globals = On

php_flag register_globals on

php_flag register_long_arrays on

 

Edit:

 

I also have:

register_long_arrays = on

 

I have even tried replacing all instances of 'HTTP_*_VARS' with _POST/_GET/_SESSION which still does not work... if my JasperServer URI is incorrect I do get the error, however when it is correct, the page just posts back to itself as if it hadn't picked up any of the post vars.

Post edited by: the478guy, at: 2008/06/09 15:23

Link to comment
Share on other sites

It is really not a good idea to edit the source code, as you can get yourself into a pickle unless you are certain you know what you are doing. I recommend you unpack it again, and don't edit it.

 

Sorry, I should have said that the "php_flag" directive would go in an Apache config, not a php.ini - my fault. Your syntax for both keywords is fine for php.ini (so you can use those instead rather than changing your apache config). Run phpinfo() in a web page to make sure they have been understood by the server.

 

Don't forget to restart your web server too.

Link to comment
Share on other sites

If they are both enabled, then you likely have another problem. What do your Apache logs or on-screen warnings say?

 

By the way, if you need help finding your apache config file (usually httpd.conf) then you will probably struggle with configuring Jasper Server. It is a steep learning curve, and as great as the software is, the help community is not particularly active.

Link to comment
Share on other sites

Got it working now by modding the session handler code. The report example is not as good as I expected, I thought it would be the same as when executing a report from the JS admin area. The paging is poor with just a next/previous button that will error if pressed on first or last page.

 

Thanks for the help anyway.

Link to comment
Share on other sites

  • 2 weeks later...

On a general note on using PHP with Jasper, PEAR's SOAP library of course is the natural choice for communicating with the server. However as far as I can tell it is written for PHP4, and so dumps a number of notices to the screen that have to be suppressed in PHP5.

 

Our web reporting service is now working nice and reliably, but nevertheless I think I will switch to a PHP5 SOAP approach when I get a moment. If anyone has already done this, please post a link to your experiences if you can.

Link to comment
Share on other sites

  • 2 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...