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

Probably a simple question...

edited April 2003 in General
I have a report that may have any number of columns on it. If there are
more columns than will fit on a page I need to print another (and possibly
another) page to print.

Page1 Page4
Column1 Column2 ..~.. Column 12 Column1 Column13 Column14
..~.. Column24 etc.

Page2 Page5
Column1 Column2 ..~.. Column 12 Column1 Column13 Column14
..~.. Column24 etc.

Page3 Page6
Column1 Column2 ..~.. Column 12 Column1 Column13 Column14
..~.. Column24 etc.


Does this make sense? I won't know exactly how many columns I will be
dealing with until runtime and then it may be only one page wide or it may
need to be several pages wide. It would be nice if Column1printed on every
page but may not be absolutely critical.

Please help! :-)

Thanks in advance,
Mark Greenhaw
OneDomain, Inc.

Please do not attempt to reply to this message:
To email me:
Remove the X's before and after xmark@onedomain.comx

Comments

  • edited April 2003
    well, you could do the following:

    you'd have to know how much collumns before you do the printing.
    the in the OnStartPage event Alter the rows accourdingly in the tppDBLabel
    on the report.
    you should have to figure out ( read: calculate) how much colums would fit
    on a page. then do some programming with ints and case statements.

    AFAIK RBuilder can't do this automagicaly

    Paul
  • edited April 2003
    Mark,

    Below is a link to an example demonstrating how to create visual column sets
    at runtime. The columns are not going to wrap to other pages. This should
    get you started. Our Report Wizard is able to wrap columns below so if you
    would like an example of this, check out our source and search on
    ReportWizard.

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

    --
    Best Regards,

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

    Thanks for the response. I have created fields on the fly and am doing so
    in this instance. My dilemma is that I may need to have more fields
    (columns) print than will fit in the width of a single page. Pages 1-3 may
    have the first columns with pages 4-... displaying the overflow columns.
    Where specifically could I find an example of this (if there is a way to do
    it)?

    If I create just enough columns to fill the the page, how do I then go back
    and print the columns that would not fit. For instance, I can fit 21
    columns on a single page but I have 33 columns. How do I print columns
    22-33?

    Thanks,
    Mark Greenhaw
    OneDomain, Inc.

    Please do not attempt to reply to this message:
    To email me:
    Remove the X's before and after xmark@onedomain.comx

  • edited April 2003
    Paul,

    Thank you for the response. I don't really understand how this would help
    though. For instance, if I have 33 columns of information and I can only
    fit 21 on the first page, how do I print columns 22-33?

    I suppose I could code a way to print two reports in sequence but that
    doesn't work for a print preview and I think page numbering would also be a
    problem (i.e. Page 1 of ?).

    Mark Greenhaw
    OneDomain, Inc.

    Please do not attempt to reply to this message:
    To email me:
    Remove the X's before and after xmark@onedomain.comx


  • edited April 2003
    I had a similar problem and so populated a string grid and then used the
    code from the JIT component demo supplied with RBuilder 7(printing from a
    StringGrid) which solved my particular problem and gave me a lot of control
    over the report content (I was printing a variable number of labels for each
    student, with barcodes whose content depended on how a particular
    examination was configured).

    Barry

    Dr Barry Clark
    Senior Lecturer & IT Systems Designer
    Medical Education Unit
    Wolfson Medical Building
    University of Glasgow
    Glasgow G12 8QQ
    Tel: 0141-330-4248
    Email: b.clark@clinmed.gla.ac.uk
  • edited April 2003
    Mark,


    You will have to use a tecnique where you generate two subreports over the
    same data, but each subreport will print different fields. In your case,
    subreport 1 will print fields 1 - 21 and subreport 2 will print 22 - 33.
    Then you can reorder the pages after they have completed generating in
    memory and send them to an actual output device manually. Try using 2
    subreports built dynamically using the previous example I sent. Below is a
    link showing how to create a report with more columns that can fit on a page
    with design-time created subreports. If you use this example in conjunction
    with the one I sent you last week, you should be able to accomplish what you
    want to do.

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

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.