report.load - Unexpected token o in JSON at position 1

Stimulsoft Reports.JS discussion
Post Reply
ysantosa
Posts: 15
Joined: Wed Sep 11, 2019 12:22 am

report.load - Unexpected token o in JSON at position 1

Post by ysantosa »

Hi - running version 2019.3.5-b

This code:

Code: Select all

const Stimulsoft = require('stimulsoft-reports-js');
const {StiOptions} = require('stimulsoft-reports-js');

const fs = require('fs');
StiOptions.WebServer.url = `http://localhost:9615`;
console.info(StiOptions.WebServer.url);
Stimulsoft.Base.StiFontCollection.addOpentypeFontFile('Roboto-Black.ttf');
const report = new Stimulsoft.Report.StiReport();
report.loadFile('simplelist.mrt');
It doesn't work - it gives me "Unexpected token o in JSON at position 1"

But if I change .loadFile to .load works:

Code: Select all

const json = JSON.parse(fs.readFileSync('simplelist.mrt'));

report.load(json);
Could this be a bug ?
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: report.load - Unexpected token o in JSON at position 1

Post by Lech Kulikowski »

Hello,

Please send us your mrt file for analysis.

Thank you.
ysantosa
Posts: 15
Joined: Wed Sep 11, 2019 12:22 am

Re: report.load - Unexpected token o in JSON at position 1

Post by ysantosa »

Hi Lech - this is .mrt from one of Stimulsoft's example in github:
SimpleList.mrt
(20.91 KiB) Downloaded 150 times
ysantosa
Posts: 15
Joined: Wed Sep 11, 2019 12:22 am

Re: report.load - Unexpected token o in JSON at position 1

Post by ysantosa »

Hi Lech (or anyone reading this),

Update on this thread: it seems there's a problem with version 2019.3.5*

Not only I got the error I mentioned above - but also: the connectionstring instead of type of 'String' - it ends up being a type of [object Object].

Downgrading to 2019.3.4 seemed to solved the issue.
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: report.load - Unexpected token o in JSON at position 1

Post by HighAley »

Hello.

We have reproduced the issue.
We need some time to make an improvement.

Thank you.
Post Reply