mikelcid
New Member
Hi all!
I first show you the code and then I will explain it:
Apart from the options to filter the data this code receives two table names and the fields to use to join them. What I want after joining the tables is to filter the data using the options received but I don't how to do this, if there exists any option in FILL() statement to do my purpose. Any idea?
Thanks in advence,
Mikel Cid, always asking
I first show you the code and then I will explain it:
Code:
CLASS crearDataSetDinamico:
DEFINE PRIVATE VARIABLE bindingSource1 AS Progress.Data.BindingSource NO-UNDO.
CONSTRUCTOR PUBLIC crearDataSetDinamico (INPUT filtro AS LOGICAL, /* Need filtering? */
INPUT fTabla AS CHARACTER, /* Table to filter */
INPUT fCampo AS CHARACTER, /* Field from the table to filter */
INPUT fFiltro AS CHARACTER, /* Filter text */
INPUT pcBuffers AS CHARACTER,
INPUT pcFields AS CHARACTER,
INPUT pcSources AS CHARACTER,
INPUT pcSourceKeys AS CHARACTER,
INPUT pcKeyValue AS CHARACTER,
OUTPUT phDataSet AS HANDLE,
OUTPUT bindingSource1 AS Progress.Data.BindingSource):
DEFINE VARIABLE iEntry AS INTEGER NO-UNDO.
DEFINE VARIABLE hDataSource AS HANDLE NO-UNDO.
DEFINE VARIABLE hBuffer AS HANDLE NO-UNDO.
DEFINE VARIABLE hQuery AS HANDLE NO-UNDO.
DEFINE VARIABLE condicion AS CHARACTER NO-UNDO.
CREATE DATASET phDataSet.
DO iEntry = 1 TO NUM-ENTRIES(pcBuffers):
phDataSet:ADD-BUFFER(WIDGET-HANDLE(ENTRY(iEntry, pcBuffers))).
END.
phDataSet:ADD-RELATION(phDataSet:GET-BUFFER-HANDLE(1),phDataSet:GET-BUFFER-HANDLE(2),pcFields).
DO iEntry = 1 TO NUM-ENTRIES(pcSources):
CREATE DATA-SOURCE hDataSource.
CREATE BUFFER hBuffer FOR TABLE ENTRY(iEntry, pcSources).
hDataSource:ADD-SOURCE-BUFFER(hBuffer, ENTRY(iEntry,pcSourceKeys)).
phDataSet:GET-BUFFER-HANDLE(iEntry):ATTACH-DATA-SOURCE(hDataSource).
END.
phDataSet:FILL().
bindingSource1 = NEW Progress.Data.BindingSource (phDataSet).
END METHOD.
END CLASS.
Apart from the options to filter the data this code receives two table names and the fields to use to join them. What I want after joining the tables is to filter the data using the options received but I don't how to do this, if there exists any option in FILL() statement to do my purpose. Any idea?
Thanks in advence,
Mikel Cid, always asking
