This sample project demonstrates how to connect to data from the code. First of all, use show() method to show the report:
private void ShowReport(DataSet dataSet)
{
	var report = new StiReport();
	report.Load(@"Reports\TwoSimpleLists.mrt");
	report.Dictionary.Databases.Clear();
	report.RegData("Demo", dataSet);
	report.Show();
}

...

Then, connect to data and call ShowReport method:
...


private void buttonXml_Click(object sender, EventArgs e)
{
	var dataSet = new DataSet();
	dataSet.ReadXmlSchema(@"Data\Demo.xsd");
	dataSet.ReadXml(@"Data\Demo.xml");

	ShowReport(dataSet);
}


private void buttonJson_Click(object sender, EventArgs e)
{
	var dataSet = StiJsonToDataSetConverterV2.GetDataSetFromFile(@"Data\Demo.json");

	ShowReport(dataSet);
}

In the screenshot below you can see the result of the sample code:

Connecting to Data from Code

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.