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

Seeking Technique Advice

edited January 2002 in General
Hello.

Delphi 5, RBPro v6.3
Win98se

I would like to learn the best way to make the report for the example data
below. I want to see if there are features I could be using, or
optimizations that could be made. I am trying to pick the brains of some of
the experienced users out there.

I am developing a listing of User-Defined data fields. They are arranged
into eight Tabs, or user-defined categories. Each tab may referance
something like 32 unique user-defined fields. This listing needs to break
when the tab changes, reprint the field level headers and then print a
listing of all of the fields for that tab. If there are no fields for that
tab, then - No Field Data - is printed instead of headers and data.

I tried to keep all of this columnar..hope it is still readable..It was done
in courier..if it is not clear, I will gladly rewrite it.

TABLE A. Field Data

TAB_NO COL_NO COL_NAME
1 1 Column One
1 2 Column Two
1 3 Column Three
3 1 Column One
3 2 Column Two
4 1 Column One
6 1 Column One
6 2 Column Two
6 3 Column Three
6 4 Column Four
7 1 Column One
7 2 Column Two
7 3 Column Three
7 4 Column Four
7 5 Column Five
7 6 Column Sics
7 7 Column Seven
7 8 Column Ate
8 1 Column One

TABLE B. Tab Data

TAB_NO TAB_LABEL
1 Tab One
2 Tab Two
3 Tab Three
4 Tab Four
5 Tab Five
6 Tab Sics
7 Tab Seven
8 Tab Eight

C.

This is my sql statement. I would like to stick with a single query, but
will asses other ideas.

SELECT
A.COL_NO, A.COL_NAME, B.TAB_LABEL
FROM
FIELD_DATA A
RIGHT OUTER JOIN TAB_DATA B
ON B.TAB_NO = A.TAB_NO
ORDER BY
B.TAB_NO, A.COL_NO

I would like my report to look like this. The dashed lines would actually be
TppLine entities.

----------------------------------------
Tab One
----------------------------------------
TAB_NO COL_NO COL_NAME
1 1 Column One
1 2 Column Two
1 3 Column Three
----------------------------------------
Tab Two
----------------------------------------
- No Field Data -
----------------------------------------
Tab Three
----------------------------------------
TAB_NO COL_NO COL_NAME
3 1 Column One
3 2 Column Two
----------------------------------------
Tab Four
----------------------------------------
TAB_NO COL_NO COL_NAME
4 1 Column One
----------------------------------------
Tab Five
----------------------------------------
- No Field Data -
----------------------------------------
Tab Sics
----------------------------------------
TAB_NO COL_NO COL_NAME
6 1 Column One
6 2 Column Two
6 3 Column Three
6 4 Column Four
----------------------------------------
Tab Seven
----------------------------------------
TAB_NO COL_NO COL_NAME
7 1 Column One
7 2 Column Two
7 3 Column Three
7 4 Column Four
7 5 Column Five
7 6 Column Sics
7 7 Column Seven
7 8 Column Ate
----------------------------------------
Tab Eight
----------------------------------------
TAB_NO COL_NO COL_NAME
8 1 Column One


Thanks in advance.

Comments

  • edited January 2002
    Table B is the master and Table A is the detail. Connect the master report
    to B. Place a subreport in the master report's detail band and connect it to
    the detail dataset for A. Use the detail subreport's NoDataBehavior property
    to display the NoData found message.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.