Версия: Stimulsoft reports.net 2013.3.1800.0
StiSqlDatabase:
Код: Выделить всё
var report = new Stimulsoft.Report.StiReport();
report.Load("Report.mrt");
StiSqlDatabase database = new StiSqlDatabase("Connection", "ConnectionString");
report.Dictionary.Databases.Add(database);
StiSqlSource stiSqlSource = new StiSqlSource("Connection", "Name", "Name", "Select * From TestBigTable");
stiSqlSource.Columns.Add("TestColumn1", typeof(string));
stiSqlSource.Columns.Add("TestColumn2", typeof(string));
stiSqlSource.Columns.Add("TestColumn3", typeof(string));
report.Dictionary.DataSources.Add(stiSqlSource);
//Out of memory
report.Render();
report.ExportDocument(StiExportFormat.Excel2007, "ExcelTest.XLSX");
Код: Выделить всё
var report = new Stimulsoft.Report.StiReport();
report.Load( "Report.mrt");
string queryString = "Select * From TestTable";
SqlDataAdapter adapter = new SqlDataAdapter(queryString, _connection);
DataSet dataSet = new DataSet();
//Out of memory
adapter.Fill(dataSet, "TestTable");
report.RegData("Name", dataSet);
report.Render();
report.ExportDocument(StiExportFormat.Excel2007, "ExcelTestDataTable.XLSX");