Code: Select all
with zsprRapports do
begin
Close;
//ParamByName('DEBUT_PERIODE').AsString := '''01.01.2009''';
//ParamByName('FIN_PERIODE').AsString := '''31.12.2009''';
StoredProcName := 'UTILISATION_FONDS_SOLIDARITE';
ParamByName('DEBUT_PERIODE').AsString := '''01.01.2009''';
ParamByName('FIN_PERIODE').AsString := '''31.12.2009''';
Open;
First;
// Compute the number of rows to be added to the StringGrid BEFORE filling the grid
SGrid1.RowCount := RecordCount + SGrid1.FixedRows;
// Fill the string grid with the results of the stored procedure
while not EOF do
begin
for intGridCol := 0 to FieldCount - 1 do
begin
SGrid1.Cells[intGridCol + SGrid1.FixedCols, intGridRow + SGrid1.FixedRows] :=
Fields[intGridCol].AsString;
end;
Next;
Inc(intGridRow);
end;
Close;
end;
Any tips to help me get round this problem will be greatly appreciated.