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).

Comments

  • edited September 2010
    Hi...

    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... >
  • edited 3:40AM
    Hi...

    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.
  • gordkgordk St.Catherines On. Canada.
    edited 3:40AM
    the secret i9s to not connect the masterdataband to a dataset.
    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;

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.