Hi everyone,
Wondering if enyone knows how to get a dataset record id?
What are you asking for? The current record number? That is usually not a useful piece of information, since the order of the records is changed by ORDER BY clauses, etc.
More to the point, what is it you are trying to do/show?
Hi everyone,
Wondering if enyone knows how to get a dataset record id?
What are you asking for? The current record number? That is usually not a useful piece of information, since the order of the records is changed by ORDER BY clauses, etc.
More to the point, what is it you are trying to do/show?
Rick Brodzinsky
Yes, the current record number. In my case, that would solve my issue.
I have multiple datasets, the row order always the same (the source order). The idea is to mark up some rows at the first pass and adjust a report at the second pass when i get a marked row.
Have you looked at the System Variable [Line]? It will number the lines(rows) of a report. If your records are always in the same order, this should then correspond to the record number.
One idea, in your band???s OnBeforePrint event, can you assign your dataset???s RecNo property to a variable and print that in the record? (Have not tried this, might give it a shot tomorrow)
Yep, my idea seems to work, but only with the FireDac components. They seem to be the only ones which publish a Record Number property from the underlying TQuery object.
First, define a Report Variable named RecNo
In the code section (fdqReg is a TfrxFDQuery)
var
  RecNo : longint;
procedure MasterData1OnBeforePrint(Sender : TfrxComponent);
begin
  RecNo := fdqReg.FDRecNo;
  set('RecNo',RecNo);
end;
Then, in the master data band, place a TfrxMemoView with [RecNo] as its contents.
Yep, my idea seems to work, but only with the FireDac components. They seem to be the only ones which publish a Record Number property from the underlying TQuery object.
First, define a Report Variable named RecNo
In the code section (fdqReg is a TfrxFDQuery)
var
  RecNo : longint;
procedure MasterData1OnBeforePrint(Sender : TfrxComponent);
begin
  RecNo := fdqReg.FDRecNo;
  set('RecNo',RecNo);
end;
Then, in the master data band, place a TfrxMemoView with [RecNo] as its contents.
Comments
What are you asking for? The current record number? That is usually not a useful piece of information, since the order of the records is changed by ORDER BY clauses, etc.
More to the point, what is it you are trying to do/show?
Rick Brodzinsky
Yes, the current record number. In my case, that would solve my issue.
I have multiple datasets, the row order always the same (the source order). The idea is to mark up some rows at the first pass and adjust a report at the second pass when i get a marked row.
One idea, in your band???s OnBeforePrint event, can you assign your dataset???s RecNo property to a variable and print that in the record? (Have not tried this, might give it a shot tomorrow)
Rick Brodzinsky
First, define a Report Variable named RecNo
In the code section (fdqReg is a TfrxFDQuery)
Then, in the master data band, place a TfrxMemoView with [RecNo] as its contents.
Rick Brodzinsky
This works for me.
Thank you, Rick!