Using DataSet as Business Object

This sample project shows how to use DataSet as Business Object in the report. You can load a data to the DataSet object and register it in the report using the RegBusinessObject() method:

public MainPage()
{
InitializeComponent();

StiReport report = new StiReport();
var asm = Assembly.GetExecutingAssembly();
using (var stream = asm.GetManifestResourceStream("UsingDataSetAsBusinessObject.MasterDetail.mrt"))
{
report.Load(stream);
}

DataSet dataSet = new DataSet();
using (var stream = asm.GetManifestResourceStream("UsingDataSetAsBusinessObject.DemoNet.data"))
{
dataSet.Load(stream);
}

report.RegBusinessObject("Demo", dataSet);
report.Dictionary.SynchronizeBusinessObjects(3);
report.Render();

viewerControl.Report = report;
}


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

Using DataSet as Business Object