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

section or child

edited June 2008 in Subreports
Hi,

I have a problem where I need to create a report with x records and y
records group by date.

date : 25/05/2008

x1
x2
x3
subtotal x
y1
y2
subtotal y
grandtotal

x and y has a totally different fields.

which subreport type should I use, section or child? How could I
generate such a report? Any sample that I can look at?

BTW, I'm using ReportBuilder 9.02 on Delphi 7.

Thanks

Comments

  • edited June 2008
    Hello,

    Please use your real name when posting to these newsgroups.
    user@domain.invalid is not an acceptable posting name. The newsgroup
    guidelines can be found at the following website.

    http://www.digital-metaphors.com/support/newsgroups.html

    I would suggest creating a master detail report. The main report would be
    connected to a dataset containing only unique dates. This dataset would be
    linked by the date field to two other datasets returning the x and y records
    respectively. The main report would then be grouped on the date field.

    Take a look at demos 71 - 73 located in the \RBuilder\Demos\1. Reports\...
    directory for some examples of creating master detail reports with multiple
    details.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2008
    Nico Cizik (Digital Metaphors) wrote:

    First of all, I would like to apologize for my mistake.

    One point to add is that the Date is extracted from x. Thus, x is master
    also the detail.

    Thanks

    Patrick
  • edited June 2008
    Hi Patrick,

    Yes, so in your case you would need a master dataset containing only
    distinct values of x, and in your detail dataset(s), you would need all
    values of x sorted on x.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2008
    Nico Cizik (Digital Metaphors) wrote:

    I still need subreport, right? What type of sub-report should I use?
    What are the settings that I will need to set?

    Thanks

    Patrick
  • edited June 2008
    Nico Cizik (Digital Metaphors) wrote:

    I have tried various way, but none success, need your advise. I used 2
    subreports to represent x and y.

    I have made some screenshots at

    http://www.webhyper.com/screen/report_main.jpg - main report
    http://www.webhyper.com/screen/subreport1.jpg - subreport 1
    http://www.webhyper.com/screen/subreport2.jpg - subreport 2
    http://www.webhyper.com/screen/result.jpg - the result

    Looking at "Hiring 3 ton..." - that's subreport 1

    1. Why subreport1 is overlapping with subreport2?
    2. Why subtotal in each subreport isn't display?
    3. There should be 2 records in subreport1, why only one is displayed?
    4. Looking at result.jpg, how can I split the 1 record and 2 records
    portion into 2 pages.

    Thanks

    Patrick
  • edited June 2008
    Hi Patrick,

    Try setting the ShiftRelativeTo property of the second subreport so they do
    not overlap.

    ReportBuilder simply traverses the data you give it. If you are only seeing
    one row, this is most likely the only row being returned by the dataset
    connected to the report.

    --
    Regards,

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

    Best Regards,

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