Hi - We are exploring potential usages for your C# libraries. We have clients who have created custom datawindows for reporting purposes and are trying determine how/if this can be supported. We are thinking of using the PowerScript.Bridge.DataObject to load the .SRD and do the retrieve.
string path = @"C:\Temp\y_dw_custom_rpt.srd";
var syntax = File.ReadAllText(path);
// Creates a DataObject object using the SRD syntax
var dataobject = new DataObject("partdatatst", syntax);
// Creates a DataStore object using the DataObject object and DataContext object
var dataStore = DataStore.Create(dataobject, _dataContext);
dataStore.Retrieve();
QUESTION: Is it also possible to use the ISqlExecutor to execute other queries matching the model and populate the dataStore (from above) that was created at runtime?
string sql = @"SELECT --- FROM -- WHERE";
var listData = _dataContext.SqlExecutor.Select<TModel>(sql);
dataStore.AddRow<TModel>(listData);
I am having issue specifying the TModel created from the .SRD. I imagine this needs to use Reflection (and/or dataStore.DwMeta.ModelType) but am unclear how to do this (if possible). Any help would be much appreciated.
Thank you,
Tony
So, there is no way to use the model from the dataStore created from the .SRD as the <TModel> in SqlExecutor?
There still seems to be no better way to use the model from the dataStore created from .SRD as <TModel> in SqlExecutor.
I suggest to submit this issue as an enhancement request to improve the compatibility of different DynamicModel objects.