I have a main report and a subreport. My purpose is to show data (which consist of Customer_code, Premise_code and other fields) from main report and sub report.

I have a main report which consist of data like Customer_Code, Premise_Code and other fields. Same fields I have in my subreport along with main report fields I have an extra field in subreport that is User_id. My purpose is to show data in main report for one Customer_Code and Premise_code below that want to show data for same Customer_code and Premise_code from subreport. likewise I want to print whole main report and subreport data.
Eg: Here for One combination of Customer_code and Premise_code in main report , I have multiple rows in subreport. I want to show one row from Main report and its corresponding rows from subreport (by passing Customer_code and Premise_code from main report to match it from sub report) just below that main report row.
Main report: Customer_code Premise_code
                         455623                 234589
                         788945                457856
                         124526                535975
Sub report:  Customer_code Premise_code  User_ID
                         455623                 234589            AS452315
                         455623                 234589           AM060185
                         788945                457856           DF264558
                         788945                457856            KL265315
                         788945                457856            PL562659
                         788945                457856            YU729014
                         124526                535975            UI095173
                         124526                535975            TY014789

Output on Crustal report:      Customer_code      Premise_code
                                                   455623                     234589
                                                    Customer_code      Premise_code   User_ID
                                                     455623                    234589               AS452315
                                                     455623                    234589               AM060185
                                                    Customer_code      Premise_code
                                                            788945                457856
                                                     Customer_code      Premise_code     User_ID
                                                         788945                457856                 DF264558
                                                         788945                457856                 KL265315
                                                        788945                 457856                 PL562659
                                                         788945                457856                 YU729014

and so on.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
You may be able to avoid a subreport with proper joins and Grouping.
If that's not viable, insert a LINKED and set the subreport property of Suppress blank subreport.
Ido MilletProfessor of MIS at Penn State Erie and Owner, Millet SoftwareCommented:
... Insert a LINKED subreport and ...

Use 2 groups
Customer then Premise Code
Put the subreport in the group header and display the details there
To link the subreport
Right click the subreport
Choose the CustomerFIeld
Click the box to filter the data based on the field
Choose the customer field in the subreport
Repeat for the Premise Field

Suppress the main report details and the group headers and footers that you don't want to show.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
agrawal_swatiAuthor Commented:
Hi All,

The solution is not working. For first time I linked both columns at one shot then tried to see the preview but it got stuck and stop responding. After it I linked only CUST_CODE and tried to run still it is not showing the correct data. any other way like if I can put anything in field explorer?
Can you upload the report?

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.