Run the server
From the application directory, start the server in command-line mode:
cd NCReportWeb
./NCReportWeb -eA standalone REST server around the NCReport reporting library for Linux and Windows. It generates reports online and returns them as PDF over HTTP.
The report engine is wrapped in an HTTP web service that runs on its own, without any additional software components. It accepts HTTP requests like a usual web server, runs the requested report and returns the PDF over HTTP. Report parameters are specified in the request URL.
No integration into a web application or language is needed. Call it by URL from any web page or application: HTML, PHP, ASP, JSP, Node.js and more.
Extract the binary package into any directory and keep the original directory structure. The Qt runtime libraries are not included in the package; install the Qt version the package was built with.
Edit etc/webapp1.ini in any text editor. Set the port, the report directory and the other server settings.
Start the server from the command line and request reports by URL.
From the application directory, start the server in command-line mode:
cd NCReportWeb
./NCReportWeb -eThe base URL shows the main page. To run a report, call the engine with the report ID: the report file name without its extension. The port and the report directory are set in the config file. Report parameters are passed as URL parameters.
# Main page
http://localhost:{port}
# Run a report
http://localhost:{port}/report?reportid=reportname
# Example
http://localhost:8080/report?reportid=group_demo
# With a report parameter
http://localhost:8080/report?reportid=group_demo&productid=512Being a standalone server, the report service needs no integration into a web application or language. Any client that can make an HTTP request can fetch a PDF. If a report fails, the response body starts with "Error".
Route::get('/reportx', function () {
$url="http://localhost:8080/report?reportid=group_demo";
$result = file_get_contents($url);
$filename = "report1.pdf";
if (substr( $result, 0, 5 )=='Error') {
return response($result);
} else {
return Response::make($result, 200, [
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'inline; filename="'.$filename.'"']);
}
});curl -o report1.pdf "http://localhost:8080/report?reportid=group_demo&productid=512"const res = await fetch('http://localhost:8080/report?reportid=group_demo&productid=512')
const pdf = await res.blob()import requests
res = requests.get("http://localhost:8080/report",
params={"reportid": "group_demo", "productid": 512})
open("report1.pdf", "wb").write(res.content)Tell us about your environment and we will get back to you within 1 business day.