Product

NCReport REST API Server

A standalone REST server around the NCReport reporting library for Linux and Windows. It generates reports online and returns them as PDF over HTTP.

Availability: the REST API Server is offered in binary form under a separate commercial license. Request a quote to get access.
Overview

A report server you call by URL

How it works

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.

System-independent usage

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.

The service start page lists every available report
Getting started

Set up in three steps

1. Install

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.

2. Configure

Edit etc/webapp1.ini in any text editor. Set the port, the report directory and the other server settings.

3. Run

Start the server from the command line and request reports by URL.

Run the server

From the application directory, start the server in command-line mode:

Terminal
cd NCReportWeb
./NCReportWeb -e

Request a report

The 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.

URLs
# 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=512

Call it from any language

Being 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.'"']);
  }
});
A barcode report returned as PDF and opened in the browser

Want PDF reports over HTTP?

Tell us about your environment and we will get back to you within 1 business day.