Page 1 of 1

Javascript Designer webserver/connection issue

Posted: Tue Dec 20, 2016 2:37 am
by Barnaby
Hey,

I'm trying to use the SQL Adapters from Http Server from the Node.JS example (https://github.com/stimulsoft/Samples-J ... p%20Server)

I'm then running a Javascript report designer, eg https://github.com/stimulsoft/Samples-J ... fault.html
Setting the webserver - StiOptions.WebServer.url = "http://127.0.0.1:9615";

I then try add a Firebird Data Source, when I hit the test connection, I get a connection error.
Image

It appears that the report designer is not sending any data on the request
Image

Nothing appears to be going through the data on the Node.js

Code: Select all

    req.on('data', function (buffer) {
        console.log('buffer', buffer);
        data += buffer;
    });
Error on the Node.js app (Which is at the "command = JSON.parse(data.toString());" as data is undefined or an empty string as per nothing through the req data.
Image

Code: Select all

    req.on('end', function () {

        command = JSON.parse(data.toString()); //line 21 - JSON.parse cant parse an empty string

        if (command.database == "MySQL") MySQLAdapter.process(command, onProcess);
        if (command.database == "Firebird") FirebirdAdapter.process(command, onProcess);
        if (command.database == "MS SQL") MSSQLAdapter.process(command, onProcess);
        if (command.database == "PostgreSQL") PostgreSQLAdapter.process(command, onProcess);
        if (command.database == "Oracle") OracleAdapter.process(command, onProcess);
    });
I am using Reports.JS version 2016.3.

Any help on this issue would be great, thanks.

Re: Javascript Designer webserver/connection issue

Posted: Tue Dec 20, 2016 8:40 pm
by Alex K.
Hello,

We have updated sample on the GitHub. Please download and check it again.

Thank you.

Re: Javascript Designer webserver/connection issue

Posted: Wed Dec 21, 2016 1:43 am
by Barnaby
Still seem to have the same issue, is below all that is needed for the Designer?

Code: Select all

<!DOCTYPE html>
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   <title>Full screen designer by default</title>

   <!-- Report designer Office2013 White Blue style -->
   <link href="./stimulsoft/css/stimulsoft.designer.office2013.whiteblue.css" rel="stylesheet">

   <!-- Stimusloft Reports.JS -->
   <script src="./stimulsoft/scripts/stimulsoft.reports.js" type="text/javascript"></script>
   <script src="./stimulsoft/scripts/stimulsoft.viewer.js" type="text/javascript"></script>
   <script src="./stimulsoft/scripts/stimulsoft.designer.js" type="text/javascript"></script>

   <!-- Report designer scripts, may be external -->
   <script type="text/javascript">
      // Set full screen mode for the designer
      var options = new Stimulsoft.Designer.StiDesignerOptions();
      options.appearance.fullScreenMode = true;

      // Create the report designer with specified options
      var designer = new Stimulsoft.Designer.StiDesigner(options, "StiDesigner", false);

      // Address to Node.js Server
      StiOptions.WebServer.url = "http://127.0.0.1:9615";

   </script>
</head>
<body>
   Set the full screen mode for the designer by default
   <br><br>

   <script type="text/javascript">
      // Show the report designer in this place
      designer.renderHtml();
   </script>
</body>
</html>
Using that page, then trying to add an SQL Data Source connection still seems to not pass anything to the Node.js SQL Adapter.

Is there anything else needed in the javascript for the client side (Designer)?

Re: Javascript Designer webserver/connection issue

Posted: Wed Dec 21, 2016 8:23 pm
by Alex K.
Hello,

We couldn't reproduce this bug.
Please send us a simple project with your changes which reproduces the issue for analysis.

Thank you.