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

TeeChar

edited September 2004 in General
Hi
I am currently using Delphi 6 Professional Update 2, ReportBuilder
Professional 7.04 and TeeChart 4.04 (shipped with Delphi 6).
I am aware of the limitations of TeeChart 4.04 inside report builder at
design time so I am interested in upgrading to the registered version if it
will do what I need.
Firstly while I have been using RB for two years now, I have not used
TeeChart at all.
I need to generate a graph that will display for each week an employees had
been paid, the total number of hours they have worked for each of the
following hour types: Normal, Overtime1, Overttime2, Overtime 3 and Sick
Leave.
So the graph would be as follows:
1 Graph per employee - multiple employees per report.
X Axis distinct pay periods, eg 01/07/2004,8/7/2004,15/7/2004 etc
Y Axis would be hours for each type of hour category. So there are 5 series
per chart.

1. Could I achieve this with v4.04 (or v7) of TeeChart
2. What format does the data in the dataset have to take, eg will I need one
record per date, per hour categery per employee.
3. I read that for singlerecord drawing a master/detail relationship for
piplelines needs to be done. Would this be required?

Thanks
Dominic

Comments

  • edited September 2004
    Hi Dominic,

    You could achieve this using TeeChart 4.04, but you as you said, you would
    not be able to design this report at Delphi design time as it does not allow
    you to assign a datapipeline. If you are looking to upgrade, I would
    recommend upgrading to TeeChart Pro 7. This will allow you to design the
    complete report at Delphi design time as well as link the pipeline in and
    preview it. Depending on how your data is set up, you may need to make a
    Master-Detail report. For instance if one table contains the names of the
    employees and another table contains the pay periods and hours, you could
    link these two tables in a master detail relationship and place the chart
    connected to the detail dataset in a subreport inside the main report's
    detail band. See the article below for more information on data traversal
    in ReportBuilder.


    ------------------------------------------------
    TECH TIP: Fundamentals of Report Data Traversal
    ------------------------------------------------


    1. Single Table Listing Report

    Assign the Report.DataPipeline property and leave the
    DetailBand.Pipeline unassigned.

    The report will traverse the data from start to end (based on the
    datapipeline range settings and honoring any filters you've placed on
    the datset etc.)


    2. Master/Detail Report:

    A. Assign the Report.DataPipeline property to the master. Create a
    subreport in the detail band and assign the childreport.DataPipeline to
    the detail datapipeline.

    Use either the visual linking features available from the Report
    Designer's Data tab, or Use standard Delphi dataset linking to define
    the relationships between the datasets.

    The Report will traverse the master records and for each, the subreport
    will traverse the detail data related to the master.


    3. Master with 2 Details

    Configure as in 2 above. Add an additional subreport to the detailband.
    Set subreport.ShiftRelativeTo property to the point to the first
    subreport. Connect the ChildReport's DataPipeline to the detail data.


    4. Report connected to no datapipelines.

    When Report.AutoStop is set to True, the Report will print a single
    detail band.

    When Report.AutoStop is set to False, the Report will print detail bands
    until instructed
    to stop. You can control when the report stops by setting the
    Report.PageLimit property or by calling Report.DataTraversalCompleted
    method. Otherwise the report will never stop.


    Additional Notes:
    ----------------

    1. SubReports have a Report property that is of type TppChildReport.
    Thus, programmatically you can code SubReport.Report.DataPipeline :=
    myDataPipeline.

    2. ChildReport's traverse data following the same rules as above. A
    ChildReport prints in its entirety each time it gets a turn to print.

    3. For a Child style SubReport use the Title/Summary band rather than
    the Header/Footer (or use a GroupHeader/GroupFooter combo). A standard
    Header/Footer will not work because these always print at the very
    top/bottom of the page.

    4. Do not filter the dataset of modify it any way once the report.Print
    command is issued. If you need to do master/detail and cannot use
    linked datasets, then use the master DataPipeline.OnRecordPositionChange
    event to filter the detail dataset.

    5. The reports and datapipelines use dataset bookmarking. Make sure
    the dataset can support bi-directional navigation.



    Check out the RBuilder\Demos\Reports\Demo.dpr project. Reports 0071,
    0072, 0073 show examples of master w/mutliple detail style reports.
    Number 0072 has two detail reports.

    --
    Best Regards,

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