How 2 print the same dataset record twice on same page
What I'm trying to do is a little hard to explain, and I'll try to be clear.
I have a dataset with 2 records, each one must be printed on one page twice, lets say that the first record is A and the Secod record is B, so, if I print it my pages should look like:
Page 1:
--
A
A
--
Page 2:
--
B
B
--
I don't want to draw the report twice on the page, so I'm trying to use a subreport and set the Child band Visible True or False in the before print event, but it's printing like this:
Page 1:
--
A
B
--
Page 2:
--
A
B
--
I'm using some code like this:
procedure ChildAOnBeforePrint(Sender: TfrxComponent);
begin
if <Product."Kind"> <> '1' then
begin
ChildA.Visible := False;
ChildA2.Visible := False;
end;
end;
How can I do it?
I already have 2 subreport objets with the desired layout, but I can't make them print twice on the same page (using the same record).
I have a dataset with 2 records, each one must be printed on one page twice, lets say that the first record is A and the Secod record is B, so, if I print it my pages should look like:
Page 1:
--
A
A
--
Page 2:
--
B
B
--
I don't want to draw the report twice on the page, so I'm trying to use a subreport and set the Child band Visible True or False in the before print event, but it's printing like this:
Page 1:
--
A
B
--
Page 2:
--
A
B
--
I'm using some code like this:
procedure ChildAOnBeforePrint(Sender: TfrxComponent);
begin
if <Product."Kind"> <> '1' then
begin
ChildA.Visible := False;
ChildA2.Visible := False;
end;
end;
How can I do it?
I already have 2 subreport objets with the desired layout, but I can't make them print twice on the same page (using the same record).
Comments
i am thinking you should use two Memo??s with the same Field and then switch to the next Page. Then you have two Rows with the same Text. On the first Page the first Record, on the second Page the second Record.
hope it??s help...
It's not just 2 memos, is a full draw report with a lot of fields, but it only ocupies half of the page, so I want 1 page to have 2 copies of it.
you set its rowcount property and you write code to control movement in the dataset.
var
ds: TfrxDataSet;
//init code block on code page
begin
ds := Report.GetDataset('frxDBDataSet1');// get by username
masterdata1.rowcount := ds.recordcount;
end.
oap event of mdband
begin
if not ds.eof then
begin
if (<line#> mod 2 = 0) then ds.next;
end;
end;