Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Fixed items in detail band

edited April 2007 in General
Hi, i need a report like this:

Header, five records in detail band and footer.
_________
| Header |
------------
__________
|__________|
|__________|
|__________|
|__________|
|__________|
________
| Footer |
-----------

I'm trying something like this, in the ppDetailBeforePrint

var
i : integer;

TForm1.ppDetailBeforePrint(sender: TObject);
begin
i := 1;
while not dbPipe.eof do begin
if i = 1 then
label1.caption := dbPipe.GetFieldValue('SOME_FIELD');
if i = 2 then
label2.caption := dbPipe.GetFieldValue('SOME_FIELD');
if i = 3 then
label3.caption := dbPipe.GetFieldValue('SOME_FIELD');
if i = 4 then
label4.caption := dbPipe.GetFieldValue('SOME_FIELD');
if i = 5 then
label5.caption := dbPipe.GetFieldValue('SOME_FIELD');

i := i + 1;
dbPipe.next;
if i > 5 then break;
if dbPipe.eof then break;
end;
end;

Well, for the first page it works, however in the following ones not.

Page 1:
=> record 1
=> record 2
=> record 3
=> record 4
=> record 5
Page 2:
=> record 11 (It should be the record 6)
=> record 12 (It should be the record 7)
=> record 13 (It should be the record 8)
=> record 14 (It should be the record 9)
=> record 15 (It should be the record 10)

Thanks

S?rgio Ricardo

Comments

  • edited April 2007
    Hi Sérgio,

    If the pipeline is connected to the report, it will also traverse your data
    each time a detail band is generated which is probably what is causing the
    error.

    Try placing single DBText components inside the detail band connected to the
    proper pipeline fields and then set the DetailBand.PrintCount to 5. This
    will print 5 records per page so there is no need to traverse manually.



    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2007
    Hi Nico,

    Thank you, for your support but:

    I have 5 shapes in detailband and need to show all shapes, even if I have
    only 2 records, is that possible?

    The labels are inside of the shapes, a label for each shape and for each
    record.

    Think about this like a form, ex:
    header
    ....space for the ?tens (fixed in 5 records, even if I have only 2, i need
    to print the 5 shapes)
    and footer.

    Thanks,

    S?rgio Ricardo

  • edited April 2007
    Hi Sérgio,

    If you are using static sized detail bands, you can try placing the shapes
    inside the page style at the proper location and this will give the effect
    you are after. I created a small demo app that shows how this can be done.

    http://www.digital-metaphors.com/tips/PageStyleShapes.zip

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2007
    Yes!, is this.

    Thank you so much.

    S?rgio Ricardo


This discussion has been closed.