- Tony Fahlberg
- SnapObjects
- Tuesday, 16 June 2020 02:19 AM UTC
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
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.