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

Feature Request - SubBands

edited September 2004 in General
Hi,

Just wanted to put in a feature request for your next release of
reportbuilder. It would be very handy, if we could add 'subbands' to either
the Header, Detail or Footerband of each report (and/or subreport).

On example where this is handy is where I need to design different
certificates for a company. The data on the certificate is almost identical,
except for a few sections. If I had the ability to put these sections (that
are different) in a subband, I could turn the visible property off/on for
these to print. (If they are turned off, then not only don't they print, but
they also move the rest of the report UP, so it doesn't have a blank space
where that particlar label was / is).

It is also handy, for when I want to have a different header for each
report - depending on the users choise. (ie - the same report may need 3
different header types, with logo's, etc). I could simply have 3 subbands
attached to the header band, with the 3 different designes, and simply turn
on the visible property for the header required at that time of printing.

Is this feesable, or possible in the next release?

Thanks & Regards

Adam Hair.

Comments

  • edited September 2004
    In article <414a393f@dm500.>, Adam Hair wrote:

    We use Subreports for this. You also could use Regions but while
    designing I prefer the Subreports, because the have seperate tabs. The
    only thing not working is the DbCalc, the always starts with 0 :(

    Gruß aus den Bergen
    Günter
  • edited September 2004
    Hi Adam,

    This can be done rather easily using subreports. A subreport can be placed
    anywhere on a report acting as a separate band as you describe or a
    completely new report. The visibility of a subreport can also be toggled as
    you need. One other nice feature of using subreports is that you can
    connect it to a completely different datasource than the main report and
    traverse that data as you need.

    Below is an example of loading a template into a subreport located in the
    header of the main report. This method can be used to create a report with
    different headers depending on the audience.

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

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2004
    H Gunter,

    Instead of using a DBCalc component, try using a TppVariable and make the
    calculations inside the OnCalc event. The TppVariable is much more
    customizable as far as when it resets and how it works with other components
    on the report. See the article below for more information.

    ----------------------------------------------------------------------
    TECH TIP: Performing Calculations
    ----------------------------------------------------------------------

    Calculations can be done either on the data access side
    or within ReportBuilder.

    When designing reports there are always decisions to be made as to
    how much processing to do on the data side versus the report side.
    Usually doing more on one side can greatly simplify the other. So it is
    often a personal choice based on the power and flexibility of the data
    and report tools being used.


    DataAccess
    ----------

    a. Use SQL - using SQL you can perform many common calculations:

    example: Select FirstName + ' ' + LastName As FullName,
    Quantity * Price AS Cost,


    b. Delphi TDataSets enable you to create a calculated TField object
    and use the DataSet.OnCalcFields event

    c. Perform any amount of data processing, summarizing, massaging
    etc. to build a result set (query or temp table) to feed to the report.


    ReportBuilder
    -------------

    Calculations in ReportBuilder are performed primarily using
    the TppVariable component.

    a. Set the Variable.DataType

    b. Code the calculations using the Variable.OnCalc event.

    c. Use the Timing dialog to control the timing of the OnCalc event.
    To access the Timing dialog, right click over the Variable
    component and select the Timing... option from the speed menu.

    d. Set the LookAhead property to True, when you need to display
    summary calculations in the title, header, group header, etc.

    e. To perform calculations based on the results of other
    calculations use the Calc Order dialog of the band. To access
    the Calc Order dialog, right click over the Band component
    and select the Calc Order... option from the speed menu.


    By using TppVariable components ReportBuilder will take care of caching
    intermediate results of accumlated calcs that cross pages.

    There are a number of calculation examples in the main demos.dpr
    project.

    ---

    Additional Notes:

    1. Do NOT use Band.BeforePrint or Band.AfterPrint. These events fire
    multiple times and therefore should not be used for calculations.

    2. Do NOT store results in variables that exist outside of the reports.
    For example - form level variables.


    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2004
    Hi G?nter & Nico,

    Thanks for the advice. I don't know why I didn't even think of subreports
    for that.

    Thanks & Regards

    Adam.
  • edited September 2004
    In article <414aee25$1@dm500.>, Nico Cizik (Digital Metaphors) wrote:

    Thank you, I know :) - But a DbCalc would be much easier.
    BTW With this solution a 'Suppress repeated values' would not work either.

    Gruß aus den Bergen
    Günter
This discussion has been closed.