A report's data connection can be swapped for a different database type at run time without editing the template.

Changing the connection. Read the original database from the dictionary and convert it with ChangeDatabaseType, then set the new connection string:
public IActionResult GetReportWithChangedDatabase()
{
    var report = new StiReport();
    report.Load(StiNetCoreHelper.MapPath(this, "Reports/Report.mrt"));

    var originalJsonDatabase = (StiJsonDatabase)report.Dictionary.Databases[0];
    var newMySqlDatabase = (StiMySqlDatabase)report.Dictionary
        .ChangeDatabaseType(originalJsonDatabase, typeof(StiMySqlDatabase));
    newMySqlDatabase.ConnectionString =
        "Server=myServerAddress; Database=myDataBase; UserId=myUsername; Pwd=myPassword;";

    return StiNetCoreViewer.GetReportResult(this, report);
}
ChangeDatabaseType keeps the report's data structure (tables, columns, relations) but retargets it to a different provider, so one template can be served from JSON during development and from a production SQL database at run time.

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