Code: Select all
var report = new StiReport();
report.Load(reportPath);
StiConfig.Services.Add(new StiSqlCeAdapterService());
StiConfig.Services.Add(new StiSqlCeDatabase());
StiSqlCeSource DSDynamic = new StiSqlCeSource("SQLCE", "Users", "Users", "SELECT * FROM [Users]", true, false);
report.Dictionary.DataSources["Users"] = DSDynamic;
foreach (StiDataColumn col in DSDynamic)
{
//This does not get hit
DSDynamic.Columns.Add(col.Name, col.Type);
}
report.Dictionary.Synchronize();
report.Compile();
report.Render();
StiPdfExportService pdfExport = new StiPdfExportService();
pdfExport.ExportPdf(report, outputPath);
Project code can be found here https://github.com/jamesamuir/reportdatatest.git