Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Supress Subreport Groups when the Group is in Main Report

Status
Not open for further replies.

ayamudua1

Technical User
Sep 29, 2003
16
US
Let me make try to be clear and provide real life data.
First. the data need to be filtered out at group level. With the live data and what I have done so far, I am sure someone will be able to help. This is the last part of my deliverables due today and it seems to give me a lot of stress.

I will be presenting 2 tables for clarity: 1 - ListingTable 2. Run-time generated table ( TempListingTable)

Table 1 is the database table and 2 is Table generated by the application and
data is from table 1.

ListingTable
CUSTOMER_ID LISTING_ID ACCOUNT_TN MAIN_LISTING_ID LISTING_STATUS LISTED_TN
------------ -------------- ---------- --------------- -------------- ----------
3331444961 330003544937 8132327600 330003544937 N 8132327600
3331444961 330003544939 8132328484 330003544939 N 8132328484
3331444961 330003544940 8137838877 330003544940 N 8137838877
3331444961 330003544941 8139098777 330003544941 N 8139098777
3331444961 330003544942 8139098777 330003544941 O 8139098777
3331444961 330003544943 8139207211 330003544943 N 8139207211
3331444961 330003544944 8139615784 330003544944 N 8139615784
3331444961 330003544945 8139615784 330003544944 N 8139615784
3331444961 330003544946 8139615784 330003544944 N 8139615784
3331444961 330003544947 8139602445 330003544947 N 8139602445

TempListingTable
CUSTOMER_ID CODE ISSUE ACCOUNT_ID LISTING_ID MAIN_LISTING_ID LISTED_TN ACCOUNT_TN
------------ ------ ------------------- -------------- -------------- --------------- -------
3331444961 012888 22 330005608853 330003544943 330003544943 8139207211 8139207211
3331444961 012888 22 330005608853 330003544947 330003544947 8139602445 8139602445
3331444961 012888 22 330005608853 330003544944 330003544944 8139615784 8139615784

As you can see above, there are only 3 listings in table 2 because those listings in the 2 has items linked to them.
As a result when the application generates the table it only pulls information related to these 3 listings

Now, i need to present the other 6 listings that is not in table 2.

A bit background.
In the main report, I am gouping each of the listings using this formula:
@listingSort
WhileReadingRecords;
totext({TempListingtable.LISTING_ID}) + totext({TempListingtable.LISTED_TN} + {TempListingtable.LISTING_ALI_CODE})

so whenever there is a change in any of the 3 fields, a new group will be created. And under the group, there will be several items pointing to that.

I created a subreport to be able pull all the information from table to display using the same formula above but with the correct table name.thus:
@listingSort
WhileReadingRecords;
totext({Listingtable.LISTING_ID}) + totext({Listingtable.LISTED_TN} + {Listingtable.LISTING_ALI_CODE})

Now this works just fine.

But the challenge I am having is the ability to suppress those groups in the subreport when the group is present in the main report.
So in this case, instead if giving me all the 10 listings, it will only give me 7.
Now, the question is, why use subreport. The reason for the subreport is so that, ALL THE LISTINGS THAT HAS NO ITEMS POINTING TO THEM TO PRINT
IN SEPERATE GROUP AFTER THOSE WITH ITEMS POINTING TO THEM.

I will give you sample data from the ITEMs & TempItemtable to give you idea of what is going on if necessary. And hope fully it will help to explain things.
Please let me know if this explanation is enough or you will like me to provide the data.

I will appreciate any help.

Thanks.

BONS
 
I agree, why use a subreport?

How is it that we should see that "2 because those listings in the 2 has items linked to them."?

Is there another table that this is joined to which determines if there's a match?

Regardless, one report can express both those that are within another table, and those that are.

The difference can be expressed by using a Left Outer join and using the function isnull().

If it's isnull(), then there isn't a related row and vice versa.

-k
 
There are several tables linked to this. However, these two that i present is what I intend to use for the subreport. the number 2 gets populated once the application runs. So, I am really using these two tables in my subreport. If using the other linked tables will help,I will provide sample data. Just note, these two tables are what is used to create the groups, so my main concern is really at the group level. Once the group is generated, the table that is used to get details is the ITEM & TempItemTables.

Please let me know if you need the ITEM & TempItemTable data.


BONS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top