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

Error printing empty subreports...

edited November 2004 in Subreports
Hi,

In my application I'm using ReportBuilder 7.02 and Data Abstract. I have a
main report with 3 sub-reports (3 detail tables). When I try to print that
report I get the error "Expression expected but nothing found" when at least
one of the detail tables is empty for that master record. I've tried using
DataPipeline linking but I just can't seem to find a sollution...

Thanks in advance
Alexandre

Comments

  • edited November 2004

    ReportBuilder supports two types of data linking. See the following article.

    For the detail datapipelines you can set SkipWhenNoRecords to true/false to
    determine the master record is skipped when there are no corresponding
    detail records.

    The datapipeline issues very simple commands on the dataset to which it is
    connected: First, Next, Prior, Last, GetBookmark and GotoBookmark.


    ------------------------------------------------------
    Tech Tip: Linking SQL Queries for Master/Detail Data
    ------------------------------------------------------

    The following example shows two options for linking SQL queries to create a
    master/detail relationship.

    In this example, we are using Delphi's DBDemos data to create a
    Customer/Order relationship. Thus we wish to link the Orders detail to the
    Customer master.

    I. Delphi Query Linking
    ------------------------

    a. Set the detail TQuery.DataSource property to point to the master
    query's TDataSource component.

    b. In the SQL "Where" clause for the detail query use a ':' followed by
    the linking field name from the master:

    example
    select *
    from orders
    where orders.CustNo = :CustNo

    Now each time the master record position changes, the detail query will
    automatically be refreshed with the correct result set.


    II. RB DataPipeline Linking
    -----------------------------

    a. Set the detail DataPipeline.MasterDataPipeline to point to the master
    DataPipeline.

    b. Use the detail DataPipeline.MasterFieldLinks property to define the
    linking relationship

    c. In the SQL for the detail, retrieve all records and sort them by the
    linking master field:

    select *
    from Orders
    order by CustNo


    Notes:

    1. Using RB DataPipeline, each query is executed only a single time - thus
    performance is much faster.

    2. RB Professional and Enterprise Editions include a visual Data environment
    for creating SQL queries, defining linking relationships, and creating
    Ask-At-Runtime parameters. Using the RB tools you could create the above
    linked queries in about 10 seconds.


    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-metaphors.com





    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited November 2004
    The problem doesn't seem to be caused by the linking (I'm using Delphi Query
    Linking). I have 2 reports in order to print both sides of the same paper.
    The first report has 1 detail table and it prints fine. The 2? report has
    all the same settings enabled and 2 detail tables, and it causes the error.


This discussion has been closed.