I set my code up when they click a button to launch the designer:
Code: Select all
StiReport report = new StiReport();
report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(new StiSqlDatabase("LobbyCentral", Program.dbConnectionString));
if (reportFilename.Equals("")) {
//New report - we need to add the DataSource
StiSqlSource mySQLDataSource = new StiSqlSource("LobbyCentral", "Table1", "Table1", "", false);
report.Dictionary.DataSources.Add(mySQLDataSource);
report.Dictionary.Synchronize();
mySQLDataSource.SynchronizeColumns();
report.Compile();
} else {
//We are loading a report that has been designed, so assume the datasource is still there.
report.Dictionary.Synchronize();
report.DataSources[0].SynchronizeColumns();
report.Compile();
}
report.Design(true);
However, when you click the Preview tab, there is no data. If I right click on the DataSource and choose View Data, I can see the rows my query returns.
What am I missing in the code?