Update report dictionary after loading mrt file
Posted: Thu Feb 22, 2024 1:09 pm
I hope to modify 'databases', 'dataSources', and 'relations' in dictionary after the report calls the loadFile function:
But MyDataSource does not appear in MyDatabase:
I couldn't establish a relationship between 'databases' and 'dataSources'. I have reviewed their interface definitions, but it seems that there are no relevant functions to associate them. Are there any examples that i can refer to?
Code: Select all
const report = new Stimulsoft.Report.StiReport();
report.loadFile(
'https://treelab-files-upload-staging-v2.treelab.com.cn/nHMwgTMqxZgrjrCDHHBU3L.mrt',
);
const database = new Stimulsoft.Report.Dictionary.StiDatabase('MyDatabase');
report.dictionary.databases.add(database);
const dataSource = new Stimulsoft.Report.Dictionary.StiDataSource(
'MyDataSource',
'MyDataSource',
);
report.dictionary.dataSources.add(dataSource);
designer.report = report;
designer.renderHtml('designer');
I couldn't establish a relationship between 'databases' and 'dataSources'. I have reviewed their interface definitions, but it seems that there are no relevant functions to associate them. Are there any examples that i can refer to?