Instead of a database connection, you can pass an in-memory DataSet directly to the report.

Preparing the data. Read or create the data source, register it in the report dictionary, synchronize the schema, and render with the supplied records.
import { Viewer, Stimulsoft } from 'stimulsoft-reports-js-react/viewer';


function App() {
    const [report, setReport] = useState<Stimulsoft.Report.StiReport>();

    function updateReport(dataSet: Stimulsoft.System.Data.DataSet) {
        var report = new Stimulsoft.Report.StiReport();
        report.loadFile('Reports/TwoSimpleLists.mrt');
        report.dictionary.databases.clear();
        report.regData('Demo', 'Demo', dataSet);
        setReport(report);
    }

    function buttonXmlClick() {
        var dataSet = new Stimulsoft.System.Data.DataSet();
        dataSet.readXmlSchemaFile('Data/Demo.xsd');
        dataSet.readXmlFile('Data/Demo.xml');

        updateReport(dataSet);
    }

    function buttonJsonClick() {
        var dataSet = new Stimulsoft.System.Data.DataSet();
        dataSet.readJsonFile('Data/Demo.json');

        updateReport(dataSet);
    }

    return (
        <div className='container'>
            <div className='container-button'>
                <button onClick={buttonXmlClick} className='button'>Register XML Data</button>
                <button onClick={buttonJsonClick} className='button'>Register JSON Data</button>
            </div>
            <div>
                <Viewer report={report} />
            </div>
        </div>
    );
}

export default App;

The DataSet is populated with readXmlFile/readXmlSchemaFile or readJsonFile, then handed to the report through regData(). Clearing dictionary.databases first removes the design-time connection.

Используя этот сайт, вы соглашаетесь на использование файлов Cookie для аналитики и персонализированного контента. Файлы Cookie хранят полезную информацию на вашем компьютере, чтобы помочь нам повысить эффективность и удобство использования. Для получения дополнительной информации, пожалуйста, прочтите Конфиденциальность и Использование Cookie.