Page 1 of 2

"Unexpected end of JSON input" error

Posted: Sat Oct 15, 2016 5:08 pm
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.

Re: "Unexpected end of JSON input" error

Posted: Sun Oct 16, 2016 8:39 am
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.

Re: "Unexpected end of JSON input" error

Posted: Mon Oct 17, 2016 6:13 pm
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.

Re: "Unexpected end of JSON input" error

Posted: Tue Oct 18, 2016 6:08 am
by Alex K.
Hello,

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

Thank you.

Re: "Unexpected end of JSON input" error

Posted: Tue Oct 18, 2016 4:34 pm
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.

Re: "Unexpected end of JSON input" error

Posted: Wed Oct 19, 2016 8:00 am
by Alex K.
Hello,

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

Thank you.

Re: "Unexpected end of JSON input" error

Posted: Wed Oct 19, 2016 2:37 pm
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.

Re: "Unexpected end of JSON input" error

Posted: Fri Oct 21, 2016 7:32 am
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.

Re: "Unexpected end of JSON input" error

Posted: Fri Oct 21, 2016 4:07 pm
by Nighty
I sent an email asking for it.

Thank you.

Re: "Unexpected end of JSON input" error

Posted: Fri Oct 21, 2016 6:22 pm
by Alex K.
Hello,

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