hi all, im having troubles using the ConvertToDataSet sentence.
I want to get the column names of a record and the data inside of the columns and show them in a form i create on the fly. To do this, i put the column names in an array and then the value in the same array but another row like a matrix.
Now, the problem i have is that when i use the ConvertToDataSet sentence with an array with the dataprovider names as a parameter, it shows an error saying the index of the array is out of bounds. This only happens if i have 2 dataprovider names, if i have 1, it is OK, but the values are not shown only the columns.
Also, i know i have the values in the array, i debugged it.
this is the code i use:
{
history.removeForm('p')
solutionModel.removeForm('p')
var tabla = databaseManager.getTable( currentcontroller.getServerName(), currentcontroller.getTableName())
var a = new Array()
a = tabla.getColumnNames()
var tope = a.length
var val
for (var i = 0; i < tope-1 ; i++)
{
val = currentcontroller.getDataProviderValue(a[1,i])
a[i,1] = val
}
var b = new Array ("Field","Value")
var ds = databaseManager.convertToDataSet(a, b)
var uri = ds.createDataSource('test', [DM_COLUMNTYPE.TEXT, DM_COLUMNTYPE.TEXT])
var jsform = solutionModel.newForm('p', uri, null, true, 300, 300);
jsform.newField("Field",SM_DISPLAYTYPE.TEXT_FIELD,100,100,100,20)
jsform.newField("Value",SM_DISPLAYTYPE.TEXT_FIELD,200,200,100,20)
forms.p.controller.show()
}
Hope you understand what i am asking for
Thank you in advance