In my one of my libraries I have a datawindow dw_example.
This datawindow is in use in other places and definitely works.
I have a function that requires a datawindow as a parameter, because it is generally called from a report window.
In this instance it is not. I need to create a datawindow on the fly from the definition of dw_example, and add a row to it,
then pass this to the function.
I have tried
dw_1 = create datawindow
dw_1.dataobject = "dw_example"
dw_1.SetTransObject (SQLCA)
liret = dw_1.Retrieve()
This does not work.
I can create a datastore dynamically and this does work
ds_1 = create datastore
ds_1.dataobject = "dw_example"
ds_1.SetTransObject (SQLCA)
liret = ds_1.Retrieve()
Is it possible to create the datawindow directly or export the definition from the datastore to the datawindow?
dumping to a blob and importing crashed the app
You can dump the datastore to a resultset, but although the manual says there is a method createfrom (resultset) for datawindows
the compiler flags this as an unknown function name.
I have had a lot of problems with this crashing my app. Many of which I suspect were to do with a watch I had in debug mode that was invalid.
Deleting that allowed me to actually get the datastore version to work where as it was not before.
I've spent a lot of time trying different methods out all of which failed or crashed until I removed the watch.
Does anyone have an idea how to achieve the creation of a datawindow variable in local code from a library definition ready to accept a new row with InsertRow ( 0 ) ?
Thank you,
Kevin.