internal void SupplyValues(Report rpt, out string[] displayValues, out object[] dataValues) { displayValues = null; dataValues = null; Rows rows = _ds.Query.GetMyData(rpt); if (rows == null) // do we already have data? { // TODO: this is wasteful; likely to reretrieve the data again when report run with parameters // should mark a dataset as only having one retrieval??? bool lConnect = _ds.Query.DataSourceDefn.IsConnected(rpt); if (!lConnect) { _ds.Query.DataSourceDefn.ConnectDataSource(rpt); // connect; since not already connected } _ds.GetData(rpt); // get the data if (!lConnect) // if we connected; then { _ds.Query.DataSourceDefn.CleanUp(rpt); // we cleanup } rows = _ds.Query.GetMyData(rpt); if (rows == null) // any data now? { return; // no out of luck } } displayValues = new string[rows.Data.Count]; dataValues = new object[displayValues.Length]; int index = 0; object o; foreach (Row r in rows.Data) { dataValues[index] = r.Data[_vField.ColumnNumber]; o = r.Data[_lField.ColumnNumber]; if (o == null || o == DBNull.Value) { displayValues[index] = ""; } else { displayValues[index] = o.ToString(); } index++; } }