How to print just current record from grid?
I'm testing FreeReport 2.33.
I've got it printing the contents of a grid, but I just want it to print the
current record (in response to a 2-click on the grid). How do I do that?
I've got it printing the contents of a grid, but I just want it to print the
current record (in response to a 2-click on the grid). How do I do that?
Comments
Anybody know what I need to do to limit the report to just one record (the current one)?
have no idea about the prob
frDBDataSet.RangeBegin := rbCurrent;
frDBDataSet.RangeEnd := reCurrent;
the report does begin (as it should) with the current record (the one I 2-click in the grid), but doesn't end there--it will print all of the records in the grid instead of just the one if I let it.
With this code in the BeginPage() event:
procedure TfViewExiters.frReportBeginPage(pgNo: Integer);
begin
if pgNo > 1 then
frReport.Terminated := True;
end;
I can prevent all of the records from being printed, but it still prints 2
plus (2 complete records, and starts the third before it "gets the message"
and terminates).
Here is my setup:
The TfrDBDataset is connected to a data source, which is connected to a
TpFIBClientDataset, which is connected to a TpFIBDatasetProvider, hooked to
a TpFIBDataset. The TClientDataSetGrid shares the same data source as the
TfrDBDataset, of course.
My code is:
procedure TfViewExiters.cdsGridDblClick(Sender: TObject);
begin
frReport.LoadFromFile('ExitInterviewRpt.frf');
frDBDataSet.RangeBegin := rbCurrent;
frDBDataSet.RangeEnd := reCurrent;
frReport.ShowReport;
end;