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

SubReport with columns

edited April 2003 in General
I'm writing a master-detail report (Delphi 5, ReportBuilder 6.03). For the
detail section, I would like the details to appear in 3 columns. I want the
traversal to be top-to-bottom. However, I would like to minimize the use of
space. For example, if the detail records, in order, were 1, 2, 3, .... 9,
I would like them to appear in 3 columns of 3:

1 4 7
2 5 8
3 6 9

It seems that the arrangment now is somewhat random. Sometimes I get 1-5 in
the first column, sometimes 1-9, etc.

Is there any way to make the report behave as I'm requesting?

Thanks,
Jennifer Graeler

Comments

  • edited April 2003
    Columnar subreports use static height detail bands. What you can do is
    calculate before each subreport prints how many records are in the detail
    dataset. Then calculate how many rows you want to have. Does each subreport
    start on a new page? Then set the column footer's height to account for the
    page space that should be the buffer so that the columns print down 3 when
    you have 9 records. Try hardcoding a report to see how setting the column
    footer's height property affects the column wrapping.

    I haven't tried this yet, but I if you want to accomplish this at runtime,
    you will use the main report's DetailBand.BeforePrint event. Check
    Report.Engine.PrintPosRect.Top. This is in microns. Then add the subreport
    top property in the band to see where the first column cell is going to
    print. Then find out how much further down the page the third cell will end
    (its bottom). Then you can subtract this from the page height, which can be
    found from Report.PrinterSetup.PageDef.mmPrintableHeight property. To
    convert between microns and report units use ppUtils function
    ppFromMMThousandths and ppToMMThousandths.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.