report.load - Unexpected token o in JSON at position 1
Posted: Mon Sep 16, 2019 3:06 am
Hi - running version 2019.3.5-b
This code:
It doesn't work - it gives me "Unexpected token o in JSON at position 1"
But if I change .loadFile to .load works:
Could this be a bug ?
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');
But if I change .loadFile to .load works:
Code: Select all
const json = JSON.parse(fs.readFileSync('simplelist.mrt'));
report.load(json);