Page 1 of 1

Do not load data from MS SQL

Posted: Sat Nov 23, 2019 9:40 am
by amamam
I use React and when load mrt file,the report do not load data from database.
My Component in react :

Code: Select all

import React from 'react';
class Viewer extends React.Component {
    render() {
        return <div id="viewerContent"></div>;
    }

       componentWillMount() {
        var report = new window.Stimulsoft.Report.StiReport();
        report.loadFile("reports/BaseProjRPT.mrt");

        report.dictionary.databases.clear();
        let connectionString = "Data Source=DESKTOP-J9;Initial Catalog=MasterDb;Integrated Security=True;User ID=amir;Password=1234";    
        let stiConnection = new window.Stimulsoft.Report.Dictionary.StiSqlDatabase("MSSQL1", "MSSQL1", connectionString);
           
         report.dictionary.databases.add(stiConnection);

        var options = new window.Stimulsoft.Viewer.StiViewerOptions();
        this.viewer = new window.Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);
        this.viewer.report = report;
    }

    componentDidMount() {
        this.viewer.renderHtml("viewerContent");
    }
}
export default Viewer;

Re: Do not load data from MS SQL

Posted: Mon Nov 25, 2019 9:02 pm
by Lech Kulikowski
Hello,

Please check the following article:
https://www.stimulsoft.com/en/documenta ... _bases.htm

Thank you.

Re: Do not load data from MS SQL

Posted: Thu Nov 28, 2019 8:22 am
by amamam
Hello,
Thank you Lech.
I resolve the problem but in code that download for node js server from above link, in package.json use version 3 of 'mssql' but
use ConnectionPool function that is for version 4 of 'mssql'.

Re: Do not load data from MS SQL

Posted: Thu Nov 28, 2019 10:42 pm
by Lech Kulikowski
Hello,

We are always glad to help you!

Thank you for the information.