"Unexpected end of JSON input" error

Stimulsoft Reports.JS discussion
Nighty
Posts: 8
Joined: Sat Oct 15, 2016 4:48 pm

"Unexpected end of JSON input" error

Post by Nighty »

I'm trying to make the report viewer work on an angularjs app with php connection to MS SQL and while it seems to be working, the rendering of my report is breaking with the "Unexpected end of JSON input" error message posted twice as shown on the attached image. The following is my script for calling the viewer:

Code: Select all

vm.reporte = function () {
        StiOptions.WebServer.url = "php/handler.php";

        var viewer = new $window.Stimulsoft.Viewer.StiViewer(null, 'StiViewer', false);
        viewer.onBeginProcessData = function (event) {
            event.connectionString = "server=***CENSORED***; uid=***CENSORED***; password=***CENSORED***; database=***CENSORED***;";
        }

        var report = new $window.Stimulsoft.Report.StiReport();
        report.loadFile('/MainV4/app/reports/TiposDocumento.mrt');

        viewer.report = report;
        viewer.renderHtml('viewer');
};
I added all the corresponding files (reports.js,viewer.js, etc. including the handler.php, helper.php, classes.php and stimulsoft adapter folder), and the connection string matches the one on my .mrt file, which connects succesfully on the designer. Is there something missing on my script? or is my .mrt file not properly made? I attached it too in case there is something I overlooked in it that needs fixing.
Attachments
TiposDocumento.mrt
(3.87 KiB) Downloaded 555 times
error.PNG
error.PNG (43.15 KiB) Viewed 8391 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: "Unexpected end of JSON input" error

Post by Alex K. »

Hello,

Please try to check the last build 2016.2.3 from 2016.10.14 and let us know about the result.

Thank you.
Nighty
Posts: 8
Joined: Sat Oct 15, 2016 4:48 pm

Re: "Unexpected end of JSON input" error

Post by Nighty »

How could I get said version? I'm running the free trial, this test I'm doing is part of the effort to get my employer to purchase for Reports.js for use in our projects.

Reinstalling the trial and using the files there yields the same result.

EDIT: Nevermind, found it, sorry for that. I'll download the build and test again.

SECOND EDIT: Tested with the 2016.2.3 build, the error continues appearing.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: "Unexpected end of JSON input" error

Post by Alex K. »

Hello,

Please send us a sample with test data which reproduces the issue for analysis.

Thank you.
Nighty
Posts: 8
Joined: Sat Oct 15, 2016 4:48 pm

Re: "Unexpected end of JSON input" error

Post by Nighty »

Below is a link to the sample package, including a one table database. The PHP version is on Apache via XAMPP 5.6.23.

https://www.dropbox.com/s/uh899444hoh6f ... e.zip?dl=0

Just change the server name on the connection strings in Main.js and TiposDocumento.mrt to make it work.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: "Unexpected end of JSON input" error

Post by Alex K. »

Hello,

We couldn't reproduce this bug.
Can you please send us a response string from developer console.

Thank you.
Attachments
Capture.PNG
Capture.PNG (206.26 KiB) Viewed 8339 times
Nighty
Posts: 8
Joined: Sat Oct 15, 2016 4:48 pm

Re: "Unexpected end of JSON input" error

Post by Nighty »

Here is my console's response....it's empty for the handler file. Also attached a screenshot of the error happening on the sample itself.
Attachments
captura2.PNG
captura2.PNG (40.54 KiB) Viewed 8337 times
Captura.PNG
Captura.PNG (64.16 KiB) Viewed 8337 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: "Unexpected end of JSON input" error

Post by Alex K. »

Hello,

We have made additional checks and we couldn't reproduce this bug on our test pc.
We need a teamview for the investigating the issue. Could you send us a request on support@stimulsoft.com with link on this topic.

Thank you.
Nighty
Posts: 8
Joined: Sat Oct 15, 2016 4:48 pm

Re: "Unexpected end of JSON input" error

Post by Nighty »

I sent an email asking for it.

Thank you.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: "Unexpected end of JSON input" error

Post by Alex K. »

Hello,

Ok. Thank you. We will reply to you by email.
Post Reply