php - Set value of an input control using JasperReports Web Services -


i using jasperreports server web services retrieve report pdf using php curl.

unfortunately, report want generate uses value input control

if don't provide value input control, report works every value 0.

according official guide : jasperreports server web services guide page 24, says should use ic_get_query_data argument in url did , provided uri of data source , used p_param_name provide value of parameter can't work, seems report not using these values.

thank in advance comment may !

you may consider using new run report mechanism (part of "restv2 services"). can supply input controls report query items in url. multi-select inputs can defined many times need selections made.

for example, if send request http://[yourserver]:[port]/jasperserver/rest_v2/reports/uri/to/my_report.pdf?state=ca&state=ok&city=sacramento

you report state control set "ok" , "ca", , city control set "sacramento"

it may beneficial use rest php wrapper make these requests more simple.

the same example above can achieved this:

$client = new jasperclient('yourserver', 'port', 'username', 'password', '/jasperserver'); $report_data = $client->runreport('/uri/to/my_report', 'pdf', null, null, array('state' => array('ok', 'ca'), 'city' => 'sacramento')); 

the binary data of report stored in $report_data , can whatever wish. (i.e: fwrite file, stream browser download... etc).


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -