procedure TForm1.FormCreate(Sender: TObject);
var
i, j: Integer;
begin
for i := 0 to StringGrid1.ColCount - 1do
for j := 0 to StringGrid1.RowCount - 1do
StringGrid1.Cells[i, j] := '1234567890'+IntToStr(j * StringGrid1.ColCount + i + 1);
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
frReport3.ShowReport;
end;
procedure TForm1.frReport3GetValue(const ParName: string;
var ParValue: Variant);
begin
if AnsiCompareText(ParName, 'Cell1') = 0 then
ParValue := StringGrid1.Cells[0, Dataset.RecNo]
else
if AnsiCompareText(ParName, 'Cell2') = 0 then
ParValue := StringGrid1.Cells[1, Dataset.RecNo]
else
if AnsiCompareText(ParName, 'Cell3') = 0 then
ParValue := StringGrid1.Cells[2, Dataset.RecNo]
else
if AnsiCompareText(ParName, 'Cell4') = 0 then
ParValue := StringGrid1.Cells[3, Dataset.RecNo]
else
if AnsiCompareText(ParName, 'Cell5') = 0 then
ParValue := StringGrid1.Cells[4, Dataset.RecNo]
end;
procedure TForm1.DatasetCheckEOF(Sender: TObject;
var Eof: Boolean);
begin
Eof := Dataset.RecNo >= StringGrid1.RowCount;
end;