I have a poblem using XML as a dataset for my report. I attached the report.mrt, xml (I cant updload xml since the board wont let me), xsd and the generated pdf files here. If I design the report in the desinger everything works fine, the data is loaded and displayed in the preview.
If I generate the report via code, the dataset is loaded - I can see some data but most data is missing - especially data within relations is not being displayed. I have read this post viewtopic.php?t=55732 and tried all the suggestions but its not working.
If I create the datasource via the designer I dont have to enter a xsd file - but if I do this via code, I get an error: "Cannot read property 'dataType' of null"
This is my code:
Code: Select all
const stimulsoftReport = new Stimulsoft.Report.StiReport();
const dataSet = new Stimulsoft.System.Data.DataSet('prescription');
dataSet.readXmlSchemaFile(`${__dirname}/schema.xsd`);
// dataSet.readXmlFile(`${__dirname}/xml.xml`);
dataSet.readXml(data);
stimulsoftReport.dictionary.databases.clear();
stimulsoftReport.regData('prescription', 'prescription', dataSet);
stimulsoftReport.dictionary.synchronize();
stimulsoftReport.loadFile(`${__dirname}/report.mrt`);