A report's data can be supplied entirely from code. This example builds a dataset from JSON and registers it with the report before showing it.

Preparing the data. Read or create the data source, register it in the report dictionary, synchronize the schema, and render with the supplied records.
private void ShowReport(DataSet dataSet)
{
    var report = new StiReport();
    report.Load(@"Reports\TwoSimpleLists.mrt");
    report.Dictionary.Databases.Clear();
    report.RegData("Demo", dataSet);
    report.ShowWithWpf();
}

// build the data (here from a JSON file) and show it
var dataSet = StiJsonToDataSetConverterV2.GetDataSetFromFile(@"Data\Demo.json");
ShowReport(dataSet);
RegData makes the object available to the report engine, and Dictionary.Databases.Clear() removes the template's design-time connections so only your run-time data is used.

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.