Hi all
I have a big problem that i can't find a solution to.
We use .NET as frontend and appserver to get data from db. To get this to work both DataTable in .NET and temp-table on appserver has to be defined identical. I would like to know if it is possible to create this temp-table dynamically.
Today it looks like this:
(.NET side)
- Strongly typed DataTable
- Building metadata for this table
- Passing datatable and metadata to appserver. (1 datatable for SearchCriteria and 1 datatable for the result)
(Progress side)
-Define temp-table with all fields.... (defined like the table in .NET, same order, same name, etc)
-Define input-output parameter table for "table".
My problem is that i now want to create the searchresult and dynamically build columns for the searchresult. The user must be able to select the columns he want in the searchresult.
Can this be done using appserver and passing temp-tables as parametes ?
I can add more parameters to this procedure (tried to pass in xml of the expected returning datatable) , but can't figure this out.
Anyone with a good idea ?
I have a big problem that i can't find a solution to.
We use .NET as frontend and appserver to get data from db. To get this to work both DataTable in .NET and temp-table on appserver has to be defined identical. I would like to know if it is possible to create this temp-table dynamically.
Today it looks like this:
(.NET side)
- Strongly typed DataTable
- Building metadata for this table
- Passing datatable and metadata to appserver. (1 datatable for SearchCriteria and 1 datatable for the result)
Code:
using (OpenAppObject oao = new OpenAppObject(conn, ""))
{
//Parameters
ParamArray parms = new ParamArray(3);
//Create metadata for activityfilter
TempTableMetaData tempMeta = GenerateMetaData(searchCriteria); //DataTable: searchCriteria
//Create metadata for searchresult.
TempTableMetaData tempMetaOut = GenerateMetaData(searchResult); //DataTable: searchResult
parms.AddTable(0, searchCriteria, ParamArrayMode.INPUT, tempMeta);
parms.AddTable(1, searchResult, ParamArrayMode.INPUT_OUTPUT, tempMetaOut);
parms.AddInteger(2, maxRowsToReturn, ParamArrayMode.INPUT);
//Run program "searchResult"
using (new PerformanceMonitor("RunSearch.p", parms, activeDatabase))
{
oao.RunProc("RunSearch.p", parms);
//Get searchresult
searchResult = (ActivityDS.searchResultDataTable)parms.GetOutputParameter(1);
}
}
(Progress side)
-Define temp-table with all fields.... (defined like the table in .NET, same order, same name, etc)
-Define input-output parameter table for "table".
Code:
define temp-table SearchCriteria no-undo
field DateOfRecord as datetime
field ActivityStatus as char.
define temp-table SearchResult no-undo
field ActivityNumber as int
field ActivityStatus as char.
define input parameter table for SearchCriteria.
define input-output parameter table for SearchResult.
define input parameter ipiNumberOfRowsToReturn as int no-undo.
...
My problem is that i now want to create the searchresult and dynamically build columns for the searchresult. The user must be able to select the columns he want in the searchresult.
Can this be done using appserver and passing temp-tables as parametes ?
I can add more parameters to this procedure (tried to pass in xml of the expected returning datatable) , but can't figure this out.
Anyone with a good idea ?