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

Using subreports or objects within subreports as test expressions in the main report

edited December 2006 in RAP
Greetings,
1. There are two subreports. Each is calling it's own separate view.
2. We are using search criteria in all three reports(main+2 subreports.)
3. Subreport2 is imbedded within a groupfooter of the main report.
4. Subreport2 contains a memofield called memofield1. It is the only
field displayed/returned by the subreport and it's datafield is used as
the search criteria for that subreport.
5. When we leave the search criteria for subreport2 blank the main
report displays 92 rows with 80 being value1 and 12 being value2.
6. But when we select value2 in subreport2 to filter on it does not
restrict the main report to only those 12. It still shows 92 rows and
for those 12 it shows the value2 selected in the search criteria. For
the other 80 it simply has a blank spot in the space allotted for the
subreport.

What I need to know is how to make sure that the search criteria of the
subreports combine properly with the search criteria of the main report
to restrict the rows or else know how to use the subreport or the
memofield in the subreport that displays the value as a test condition
to set the band in which it lays visibility setting to either 'true' or
'false'.


Thanks!

JG.

Comments

  • edited January 2007

    - for future reference please configure your newsreader to post using your
    first and last name.

    - please try to post to the most relevant newsgroup. If you are using the RB
    Data workspace (DADE) to create SQL queries and autosearch criteria, then
    please post to the DADE newsgroup. (The RAP newsgroup is focused on the
    run-time Pascal environment included with RB Enterprise).

    - if you have a main report and two subreports, then you will typically
    have a main query and two detail queries. The detail queries will be linked
    to the main query. You can define a linking relationship by dragging the
    detail field to the master field. RB will then augment the detail SQL with
    some special linking SQL (to view the linking SQL, press ctrl + left mouse
    while positioned over the dataview tool window.)

    - search criteria are associated with a SQL query. RB will dynamically build
    the SQL Where clause to use the autosearch values entered by the user.
    Applying search criteria to the master query will affect the detail queries,
    but not vice versa. From your description I think you need to build the
    master query to contain the search criteria necessary to produce the main
    report in the manner in which you describe.

    -------------------------------------------
    Tech Tip: Linking DataViews
    -------------------------------------------

    Overview
    ---------

    Linking DataViews in the ReportBuilder Data workspace (DADE), requires that
    the detail data be sorted by the linking fields. When DataViews are linked,
    DADE generates special linking SQL for the detail DataView. The linking SQL
    (Magic SQL) can be viewed by positioning the mouse over the DataView window
    and pressing Ctrl + Left Mouse button. The results of the Magic SQL query
    can be viewed by pressing Shift + Left Mouse button.

    ReportBuilder's DataPipeline architecture includes support for linked data
    traversal. Whenever the record position of the master data changes, the
    traversal logic compares the master and detail field link values and then
    determines where to locate the record position for the related detail data.
    The linking logic will only work properly if the Database engine's collation
    of the detail query result set is in sync with ReportBuilder's internaly
    field link comparison logic.


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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.